locked
Mobile SelectionList RRS feed

  • Question

  • User451044505 posted

    I am writing a web based program for the Symbol MC50 (Windows 2003 Mobile 2nd Edition)

    I am having problems with SelectionList showing entries. I need to obtain the data from an existing database. 

    If I use the following code it works on the MC50.

    <mobile:Form id="Form1" runat="server">

    <mobile:Label ID="Label2" Runat="server">Username:</mobile:Label>
        
    <mobile:SelectionList
            ID="List1" Runat="server">
            <Item Text ="John"/>
            <Item Text ="Peter"/>
            <Item Text ="Henry"/>
    </mobile:SelectionList>

    <mobile:Label ID="Label3" Runat="server">Password:</mobile:Label>

    <mobile:TextBox ID="txtPassword" Runat="server" Alignment="Left" Password="True"></mobile:TextBox>

    <mobile:Command ID="btnAccept" Runat="server">Accept</mobile:Command>

    </mobile:Form>

    If I gather the data from a database as follows - it does not show the list:

    <mobile:Form id="Form1" runat="server">

    <mobile:Label ID="Label2" Runat="server">Username:</mobile:Label>
        
    <mobile:SelectionList ID="List1" Runat="server"></mobile:SelectionList>

    <mobile:Label ID="Label3" Runat="server">Password:</mobile:Label>

    <mobile:TextBox ID="txtPassword" Runat="server" Alignment="Left" Password="True"></mobile:TextBox>

    <mobile:Command ID="btnAccept" Runat="server">Accept</mobile:Command>

    </mobile:Form>

    Sub Form1_Init

        connection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|datadirectory|data.mdb;")
                
        connection.Open()
                
        myData = New OleDbDataAdapter("select staff_name from qrystaffmast", connection)
                
        rs = New DataSet()
                
        myData.Fill(rs, "Staff")

        List1.DataSource = rs.Tables("Staff").DefaultView
        List1.DataTextField = "staff_name"
        List1.DataBind()

    End Sub

    And even if I do as follows it still does not work:

    Sub Form1_Init

                List1.Items.Add("Daryl")
                List1.Items.Add("Peter")
                List1.Items.Add("John")
                List1.Items.Add("Mary")
                List1.Items.Add("Joan")
    End Sub

    Wednesday, December 12, 2007 3:03 AM

All replies

  • User113421904 posted

    Hi,

    Did you mean the SectionList is empty when it is displayed in IE Mobile?

    The example in the following will tell you which are the required properties.

    http://msdn.microsoft.com/en-us/library/aa710904(VS.71).aspx

    Hope it helps.

    Monday, December 17, 2007 6:23 AM
  • User-1223057304 posted

     HI

     i am also having experience in mobile.

    in selection list control properties,just specify the 1.DataTextField and 2.DataValueField

    i think tis is the problem

    regards

    Meenakshi Sundaram
     

    Tuesday, December 18, 2007 3:05 AM