Hi I need to call the SelectedIndex event after loading the form.
The reason for this is that the dropdownlist determines if other controls are displayed on the form
here is a example of the idea
The issue is that the call does not happen and the line
Does not seem to work ?
What I get in the options value is a empty string ?
Any ideas
The reason for this is that the dropdownlist determines if other controls are displayed on the form
here is a example of the idea
Partial Class Example Public Function LoadData() As Boolean Me.DropDownList1.DataSource = Types.ConfirmationType If Not CustomerName Is Nothing Then ' Where the DropDownlist ID is DropDownList1 Me.DropDownList1.SelectedText = "Driver" ' Calls the method directly passing the appropriate sender Me.DropDownList1_SelectedIndexChanged(Me.DropDownList1, Nothing) End If End Function Protected Sub DropDownList1_SelectedIndexChanged(sender As System.Object, e As Telerik.WinControls.UI.Data.PositionChangedEventArgs) Handles DropDownList1.SelectedIndexChanged Dim options As String = Me.DropDownList1.SelectedText Select Case options Case "Driver" 'Display the Driver mobile fields Me.lblDriverMobile.Visible = True Me.txtDriverMobile.Visible = True Me.ddlDriverMobileCode.Visible = True Me.pbDriverMobile.Visible = True Case Else 'Hide the Driver mobile fields Me.lblDriverMobile.Visible = False Me.txtDriverMobile.Visible = False Me.ddlDriverMobileCode.Visible = False Me.pbDriverMobile.Visible = False End Select End SubEnd ClassThe issue is that the call does not happen and the line
Me.DropDownList1_SelectedIndexChanged(Me.DropDownList1, Nothing)Does not seem to work ?
What I get in the options value is a empty string ?
Any ideas