This is a migrated thread and some comments may be shown as answers.

scroll position move after using beginupdate() and endupdate()

3 Answers 338 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Sason
Top achievements
Rank 1
Sason asked on 04 Nov 2010, 08:20 AM
Hi

 

When the user scroll to the middle or the end of the grid and then I use beginupdate() and endupdate()

The scroll position return to the beginning of the grid and not stay where it was.

Thank you

Dror.

3 Answers, 1 is accepted

Sort by
0
Accepted
Phi
Top achievements
Rank 1
answered on 04 Nov 2010, 02:22 PM
I think this is normal behavior for many controls including .Net controls. For example, you editing text inside a richtextbox, you could scroll down to see other text but the cursor in the control is still wherever it is before.

I don't know if gridView exposes the scrollbar's position or not. If it is, you could save that information before update and restore it after endupdate.

I just saw an example relating to scrolling information here
0
Sason
Top achievements
Rank 1
answered on 07 Nov 2010, 01:07 PM
Thank you.
0
Emanuel Varga
Top achievements
Rank 1
answered on 07 Nov 2010, 01:20 PM
Hello Dror,

You could also remember the selected row index before the begin update operation, and just reselect that row before the EndUpdate() operation (or just after, depending on the operations performed), this will keep the grid at it's previous position.

Hope this helps, if you have any other questions or comments, please let me know,

Best Regards,
Emanuel Varga
Tags
GridView
Asked by
Sason
Top achievements
Rank 1
Answers by
Phi
Top achievements
Rank 1
Sason
Top achievements
Rank 1
Emanuel Varga
Top achievements
Rank 1
Share this question
or