DataGrid page level delete all function

G

Guest

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
 
S

S.M. Altaf [MVP]

Hi,

You'll need to perform a check yourself by looking at the CurrentPageIndex property and comparing it with recordcount divided by pagesize. If the CurrentPageIndex is larger, reset it to the value you get when you divded the recordcount and page size.

HTH,
Altaf



--------------------------------------------------------------------------------

All that glitters has a high refractive index.
www.mendhak.com

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top