Click here to Skip to main content
16,023,047 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have a problem with my GridView. I made the pagesize = 5 and when I added new records to the grid (7,8 records), there will be 2 pages. The problem is that when I press the edit buttom for a record in the second page, it shows all the records and chooses the position of the record to edit it (like if I choose record 6, the edit button shows the whole 8 records and takes the first record to edit it, not what I choose for editing).

I have this in pageindexChanging:

gvClients.PageIndex = e.NewPageIndex;
            vBindgvClients();


Any thoughts??!!
Posted
Updated 8-Dec-09 12:01pm
v3

1 solution

I think that the EditItemindex is not persisted.
Since you give bind the datagrid in pageIndexChange event, the edititemIndex is lost.
So, save the edit itemindex before binding the grid in pageIndexChanged event in a varaible and set that after binding so that it points to the correct record
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900