G
Guest
I'm getting an "invalid cast" error message when trying do use Dataview.Find() method to get the row I need to update in my datagrid. The problem just occurs after I sort the datagrid by a non default order.
// Update grid code
string key = DataGrid1.DataKeys[e.Item.ItemIndex].ToString();
int rowIndex = dv.Find(key);
//Sort Grid code
dv.Sort = e.SortExpression;
DataGrid1.DataBind();
// Update grid code
string key = DataGrid1.DataKeys[e.Item.ItemIndex].ToString();
int rowIndex = dv.Find(key);
//Sort Grid code
dv.Sort = e.SortExpression;
DataGrid1.DataBind();