Datagrid Inserts and Paging

C

ComStar

I have a grid that allows inserts and has paging. The inserts work fine
when the new item is on the 1st page. The blank line is inserted and I'm in
edit mode. If the new item is on a page other than the 1st, a new blank
record is added and I have to manually go to that page and edit the item.

How can I determine that the new item is on a new page and go directly to
that page in edit mode?

I'm using VB and the insert does a .newrow.
 
A

Alvin Bruney [MVP]

one approach would be to loop the datagrid looking for the edititemindex
property which should not be equal to -1. Once you find it, you can make a
note of where the index is relative to the record count and then figure out
the page it is on. The assumption is that you know the number of records per
page.

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ http://tinyurl.com/27cok
 

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

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,144
Latest member
KetoBaseReviews
Top