Print Page | Close Window

Programatically Change Scroll Bar Pos

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Property Grid
Forum Description: Topics Related to Codejock Property Grid
URL: http://forum.codejock.com/forum_posts.asp?TID=3078
Printed Date: 23 November 2024 at 1:14pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Programatically Change Scroll Bar Pos
Posted By: Milkman
Subject: Programatically Change Scroll Bar Pos
Date Posted: 21 October 2005 at 3:02pm
Hello,

I have a property grid reading records from a database.  The record structure changes dynamically from record-to-record.  Everytime I move to a new record I use the BeginUpdate/EndUpdate methods (with the PropertyGridContext option) to delete all the propertygrid items and then recreate a new property grid based on the current record information.

There is also an option to change the current record structure on the fly, which in turn called the same begin/endUpdate methods.  Unfortunately whenever something is added and the scroll bar is at a position other than the top, the scroll position changes.

Is there any way to programatically change the scroll bar position to, for instance, make a particular item located at the top of the grid?

Any help would be appreciated.





Replies:
Posted By: SuperMario
Date Posted: 24 October 2005 at 9:31am
Try using PropertyGridItem.EnsureVisible method.  This will scroll to a specific item of your choice.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net