I have the following issue with my grid needdatasource method, can't figure out why this keeps happening and its killing me:
void grid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
RadGrid grid = (RadGrid)sender;
string id = grid.ID;
DataTable current = (DataTable)HttpContext.Current.Session[int.Parse(id.Split(new string[] { "RadGrid" }, StringSplitOptions.RemoveEmptyEntries)[0])];
grid.DataSource = current;
}
If i go to the page directly no problems what so ever, everything works perfect,but if i try to navigate to that page from a different page, lets say using server.trasnfer or response.redirect, i keep getting this error:
Unable to cast object of type 'System.Int32' to type 'System.Data.DataTable'.
On this line, does anyone know why this would happen or how to fix it?
void grid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
RadGrid grid = (RadGrid)sender;
string id = grid.ID;
DataTable current = (DataTable)HttpContext.Current.Session[int.Parse(id.Split(new string[] { "RadGrid" }, StringSplitOptions.RemoveEmptyEntries)[0])];
grid.DataSource = current;
}
If i go to the page directly no problems what so ever, everything works perfect,but if i try to navigate to that page from a different page, lets say using server.trasnfer or response.redirect, i keep getting this error:
Unable to cast object of type 'System.Int32' to type 'System.Data.DataTable'.
On this line, does anyone know why this would happen or how to fix it?