In my scenario, I have a RadComboBox that contains CheckBox items. I problematically set certain items as Checked, if data exists in a database table. Here is a segment of code:
' now, check anything that is really checked.
Dim idr As Data.DataRow
Dim ids As Data.DataSet
Dim idt As Data.DataTable
Dim idtData As New Data.DataSet
Dim iParameters(0 To 0) As Data.SqlClient.SqlParameter
iParameters(0) = New Data.SqlClient.SqlParameter("@intBIDOID", CheckDBNull(CInt(BIDOID), enumObjectType.IntType))
ids = clsEPD_DATA.StoredGetDataset("spGetBidsSystemTypeNames", iParameters)
If ids.Tables(0).Rows.Count >= 1 Then
idt = ids.Tables(0)
For Each idr In idt.Rows
' "BUG" - when one and ONLY one item is check-marked, here, it causes the control to
' be in a state as if SelectedIndex has been changed (Telerik states this is expected).
' And, it stays that way, even though we set it here, and the user did NOT change anything.
' This is a "bug" in our scenario, where I must determine if the USER DID THE CHANGE,
' not the program.
Dim cboSTObject As RadComboBoxItem = cboSystemType.FindItemByValue(CheckDBNull(idr("SYSTOID"), enumObjectType.IntType))
cboSTObject.Checked = True
'------------ end of System Type checkboxed combobox ----------------------
Here is the aspx snippet:
"Select the System Type (if any):"
ConnectionString="<%$ ConnectionStrings:EPD_DATAConnectionString %>"
What I would like to do is create code such that when my programmatic method changes the index (which appears only to occur when only ONE items is check-marked, but never when zero, or two or more, items are check-marked by the program), that I can somehow set the SelectedIndex code to ignore it, but when the USER MAKES A CHANGE, then I pay attention to it. Should I create an internal variable "flag" in my program to somehow watch for when I make changes pro grammatically, but clear the flag? This seems clunky.
Any guidance would be appreciated. Thank you.