F
Franck Diastein
Hi,
I have successfully set Paging in one of my DataGrids...
But I have a problem, when I use this code:
//************************** Code
private void dgMyDataGrid_ItemCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e) {
int _ID = -1;
_ID = int.Parse(dgMyDataGrid.DataKeys[e.Item.ItemIndex].ToString());
// My DB stuff using _ID
}
//************************** Code
When I load second page of DataGrid I have this error:
Index was out of range. Must be non-negative and less than the size of
the collection. Parameter name: index
And the 'wrong' line of code is:
_ID = int.Parse(dgMyDataGrid.DataKeys[e.Item.ItemIndex].ToString());
Any idea ?
TIA
I have successfully set Paging in one of my DataGrids...
But I have a problem, when I use this code:
//************************** Code
private void dgMyDataGrid_ItemCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e) {
int _ID = -1;
_ID = int.Parse(dgMyDataGrid.DataKeys[e.Item.ItemIndex].ToString());
// My DB stuff using _ID
}
//************************** Code
When I load second page of DataGrid I have this error:
Index was out of range. Must be non-negative and less than the size of
the collection. Parameter name: index
And the 'wrong' line of code is:
_ID = int.Parse(dgMyDataGrid.DataKeys[e.Item.ItemIndex].ToString());
Any idea ?
TIA