Setting selection in a rad combo box
I'm sure this is quite simple but I can't seem to get it to work. I'm just trying to set the selection of a RadComboBox using its onDataBound function.
protected void ReTo_DataBound(object sender, RadComboBoxItemEventArgs e)
{
if (e == null) throw new ArgumentNullException("e");
var combo = sender as RadComboBox;
if (combo.FindItemByText("Jack Johnson")开发者_JS百科 != null)
combo.FindItemByText("Jack Johnson").Selected = true;
}
I think i'm calling the combobox incorrectly.
Thanks for any help.
I can't solve it from here but your FindItemByText is "smelly" :), don't look for a item by his string value, it could be one char difference...
Try to check item by value not text and see what happens.
cheers
精彩评论