Hi,
Here is my issue. I have a datagrid on my aspx page. I have paging enabled
for the datagrid. Suppose Suppose I have 3 pages in my datagrid. When I go to
the last page (which is the 3rd page here) and select all the messages and
delete, since the delete is on a page level, it deletes all the messages on
that page. But the problem is that since now my datagrid doesnt' have a 3rd
page and I am still on the 3rd page, its throwing an error. Any
ideas/solutions on how to tackle this.
Thanks in advance.
Pradeep
Phillip Williams - 28 Oct 2005 23:22 GMT
Keep a counter of the number of rows deleted (iNoOfRecordsDeleted) then
before you rebind the grid, check for:
If iNoOfRecordsDeleted = datagrid1.PageSize AndAlso
datagrid1.CurrentPageIndex = datagrid1.PageCount - 1 Then
datagrid1.CurrentPageIndex -= 1

Signature
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
> Hi,
> Here is my issue. I have a datagrid on my aspx page. I have paging enabled
[quoted text clipped - 7 lines]
> Thanks in advance.
> Pradeep