I'm using the Q1 / 2008 version of the rad combo box.
When I bind my combo box, I set AppendDataBoundItems = True because I want to insert an item with "-- Please Select --". Here is the code:
Dim strSelect As String
Dim dr As DataRow
Dim objDictionary As Dictionary
strSelect =
"-- Please Select --"
objDDL.DataSource = dt
objDDL.DataTextField = strText
objDDL.DataValueField = strValue
objDDL.DataBind()
Dim objDDLItem As Telerik.WebControls.RadComboBoxItem = New Telerik.WebControls.RadComboBoxItem("-- " & objDictionary.GetLabel(Labels.PLEASESELECT) & " --", "-1")
objDDL.AppendDataBoundItems =
True
objDDL.Items.Insert(0, objDDLItem)
As a result, I get the items duplicated (1 list of items, then the other). I've noticed that the .DataBound event fires twice for the combo box. When I view the Call Stack for the second .DataBound event, there is no source for the call.
If I set AppendDataBoundItems = false, then the .DataBound event only gets fired once, and I only have 1 list of items. However, I do not get the "-- Please Select --" item added.
I've also tried to add the "-- Please Select --" item to the combo box (as in numerous examples), but I still get the same results.
Thanks!