I have a combo box that I am attempting to populate in the page_load event and want the item in the combo box that corresponds to an incoming request string member value to be selected when done. I have done this before and am not a "greenie", but I cannot get any item selected in the combo box.
The definition of the combo box is in the code block immediately below:
The server-side code behind code is immediately below this line:
Can you please tell me what I am doing wrong? The combo box is being populated correctly...but no item is selected when the page_load event completes and the page is visible. Why?
Thanks in advance!
Lynn
The definition of the combo box is in the code block immediately below:
<telerik:RadComboBox ID="SearchCountry" TabIndex="5" style="z-index: 9000;" Width="200px" EnableEmbeddedSkins="true" Skin="Sitefinity" runat="server" Height="150px" OnClientSelectedIndexChanging="LoadSearchStateProv"></telerik:RadComboBox>The server-side code behind code is immediately below this line:
Try Dim reader As SqlDataReader = cmd.ExecuteReader() Do While reader.Read() RCBI = New RadComboBoxItem() RCBI.Text = reader(sFieldToPopulate) RCBI.Value = reader("CodeList") If oValueToMatch = RCBI.Value Then RCBI.Selected = True End If RadComboBox1.Items.Add(RCBI) Loop reader.Close() reader = NothingCatch ex As Exception Throw New ApplicationException("Error reading to populate country combo box from Select Statement=" & ComboSelectStmt & ". Code=" & ex.Message)FinallyEnd TryCan you please tell me what I am doing wrong? The combo box is being populated correctly...but no item is selected when the page_load event completes and the page is visible. Why?
Thanks in advance!
Lynn