Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Technique for grids remembering current row after refres
Message
 
To
28/05/2007 19:04:08
Walter Nicholls
Cornerstone Software Ltd
Auckland, New Zealand
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01228829
Message ID:
01229186
Views:
15
Walter,

>> I'll settle for positioning on the previous row (remembered)
>
>One of my notorious hanging sentences. I meant, I'll settle for positioning on the previous (remembered) row if it is still in the dataset/view after refresh, go to top row if the remembered row is no longer available to view.
>
>In previous (VFP) work I've had the ability to position on 'nearest' record by some criteria (SET NEAR ON locate sort of thing), and positioning on newly added rows. This shouldn't be too hard to add in later.

Unfortunately, this isn't as straightforward as you hope it would be!

You could subclass mmGridView, add a new property (RestorePositionOnBind, for example). You can add code to mmGridView.OnBindData() that saves the PK of the current row before data binding. After binding, it could then check if the row with the specified PK is still in the list, and if so, set the DataGridView's FirstDisplayedScrollingRowIndex to the index of that row.

Best Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Previous
Reply
Map
View

Click here to load this message in the networking platform