I've got another RadGrid problem. One column in my grid is a DropDown that is getting its values from a SqlDataSource. The cell is defined as:
The drop down list is getting populated fine. I am using edit in place for the editing and can select a value from the list okay. On the back end for the update, I've got (in part):
I'm getting an error at run time after editing a row when I include that code. If I remove the code that adds the store drop down from the update, it works fine (but of course doesn't update that field.) I've tried other variations such as "string store = (editedItem["store"].Controls[0] as DropDownList).SelectedItem.Value" with no luck.
The error is "Message: Sys.WebForms.PageRequestManagerServerErrorException: Object reference not set to an instance of an object.
Line: 6
Char: 62099
Code: 0"
Any ideas? Thanks!
<telerik:GridDropDownColumn DataField="store" HeaderText="Store" UniqueName="store" DataSourceID="SqlDataSource2" ListTextField="store" ListValueField="store"></telerik:GridDropDownColumn>The drop down list is getting populated fine. I am using edit in place for the editing and can select a value from the list okay. On the back end for the update, I've got (in part):
protected void RadGrid1_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) { string store = (editedItem["store"].Controls[0] as DropDownList).SelectedValue.ToString(); }I'm getting an error at run time after editing a row when I include that code. If I remove the code that adds the store drop down from the update, it works fine (but of course doesn't update that field.) I've tried other variations such as "string store = (editedItem["store"].Controls[0] as DropDownList).SelectedItem.Value" with no luck.
The error is "Message: Sys.WebForms.PageRequestManagerServerErrorException: Object reference not set to an instance of an object.
Line: 6
Char: 62099
Code: 0"
Any ideas? Thanks!