Hello guys.
I have a combobox with load on demand in a gridtemplatecolumn. For new registries my combo works fine, but, for update I have a problem. In the itemDataBound event (edit mode), I bind the combo with a value and a text (only 1 item), and, when I start the combo's ItemsRequested event, my combo have at the finish, a duplicated item.
I tryed do remove the item in ItemsRequested event,
or, not insert the item that already exist, but I have no sucess.
What is the best practice for it?
Thanks in advance.
Regards.
I have a combobox with load on demand in a gridtemplatecolumn. For new registries my combo works fine, but, for update I have a problem. In the itemDataBound event (edit mode), I bind the combo with a value and a text (only 1 item), and, when I start the combo's ItemsRequested event, my combo have at the finish, a duplicated item.
I tryed do remove the item in ItemsRequested event,
if (combo.Count == 1) |
{ |
combo.Items[0].Remove(); |
combo.Text = ""; |
combo.ClearSelection(); |
} |
or, not insert the item that already exist, but I have no sucess.
if (combo.Items.Count > 0) |
{ |
if ( itemToInsert != combo.Items[0].Value) |
{ |
combo.Add(new RadComboBoxItem(TextToInsert, valueToInsert)); |
} |
} |
What is the best practice for it?
Thanks in advance.
Regards.