I can update just fine in a custom templated form but when I click the "Add new record" button that is generated by the RadGrid, I get an exception in my "InstantiateIn" method of "Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index". I'm guessing I have to check whether the grid is performing an insert vs and update, but I'm not sure how to do this.
public void InstantiateIn(System.Web.UI.Control container) |
{ |
//This throws exception |
GridEditFormItem item = ((GridEditFormItem)(container.NamingContainer)); |
} |