Mike Harris
5/28/2002 3:47:00 PM
Additional information that I have found:
When I statically fill the list at design time the
selection list control returns the expected values in the
selection property and the selectedindex property.
When I dynamically fill the list at run time with either
the Add of the item as shown, or with a data binding with
an arraylist the selectionlist control returns a selection
property set to nothing and selectedindex property set to -
1.
Thanks
Mike Harris
>-----Original Message-----
>I am working to learn the Mobile programming for PDA
>devices. I have written the following code as a learning
>excercise. When I try to retrieve the selection from the
>selection list control it is either Nothing and the
>selected is always -1. How do I retrieve the selected
>item? Can anyone enlighten me?
>
>Thanks
>
>
> Private Sub Page_Load(ByVal sender As System.Object,
>ByVal e As System.EventArgs) Handles MyBase.Load
> 'Put user code to initialize the page here
> SelectionList1.Items.Clear()
> SelectionList1.Items.Add("Notebooks")
> SelectionList1.Items.Add("Tablets")
> SelectionList1.Items.Add("Pens")
> SelectionList1.Items.Add("PDAs")
> SelectionList1.Items.Add("Paper")
> End Sub
>
> Private Sub Command1_Click(ByVal sender As
>System.Object, ByVal e As System.EventArgs) Handles
>Command1.Click
> Session.Clear()
> Session.Add("TextValue", TextBox1.Text)
> Session.Add("SelectionValue",
>SelectionList1.Selection.Text)
> Me.RedirectToMobilePage("MobileWebForm2.aspx")
> End Sub
> Private Sub SelectionList1_SelectedIndexChanged(ByVal
>sender As Object, ByVal e As System.EventArgs) Handles
>SelectionList1.SelectedIndexChanged
> Dim lindex As Long
> lindex = SelectionList1.SelectedIndex
> Session.Add("SelectionValue",
>SelectionList1.Selection.Text)
>
> End Sub
>
>.
>