Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / October 2005

Tip: Looking for answers? Try searching our database.

DataGrid page level delete all error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Pradeep - 28 Oct 2005 22:38 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.