C
CW
Is this by design or is it a bug?
If you have a pageable datagrid. After you delete a row from the grid (which
results in a reduction in the number of pages of the datagrid), asp.net
throws an error because CurrentPageIndex is set to -1.
The error is thrown when you call the databind method on the datagrid after
the deletion from the underlying dataset.
I can get around it by checking the CurrentPageIndex value after a delete
statement (before calling DataBind). The code is ugly in order to determine
the proper total number pages. It's just annoying that I have to hack it
that way.
Any idea how to get around it? or DataGrid only has that much intelligence?
If you have a pageable datagrid. After you delete a row from the grid (which
results in a reduction in the number of pages of the datagrid), asp.net
throws an error because CurrentPageIndex is set to -1.
The error is thrown when you call the databind method on the datagrid after
the deletion from the underlying dataset.
I can get around it by checking the CurrentPageIndex value after a delete
statement (before calling DataBind). The code is ugly in order to determine
the proper total number pages. It's just annoying that I have to hack it
that way.
Any idea how to get around it? or DataGrid only has that much intelligence?