I am using a RadGrid with several editor columns, including a CheckBox, DropDownList (RadComboBox style), and a Template column.
When editing, I'm easily able to get a handle on these controls using the following code:
if (e.Item is GridEditableItem && e.Item.IsInEditMode) |
{ |
RadComboBox list = (e.Item as GridEditableItem)["MethodColumn"].Controls[0] as RadComboBox; |
Prometheus.SetRadComboBoxHeight(list,_maxComboBoxItems,_pixelsPerComboBoxItem); |
list.AutoPostBack = true; |
list.SelectedIndexChanged += MethodRadComboBox_SelectedIndexChanged; |
} |
This works in both the ItemCreated event as well as in the ItemDataBound event of the grid. I've also gotten it to work using the GetColumnEditor function.
But, when adding (by simply setting the MasterTableView.IsItemInserted value = true in a RadToolBar button click), this same code above does not work. The GetColumnEditor function returns null, and the method above (...["ColumnName"].Controls[0]) returns a literal object. Is there something specific I need to do for an "Add" in order to get a handle on these controls?
I've spent the better part of a day on this and frankly, I'm stumped.