You need to derive a new class from the DataGrid class and add a method
to expose the scrolling.  There is a protected member called
GridVScrolled that you can use to scroll.
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/
html/frlrfsystemwindowsformsdatagridclassgridvscrolledtopic.asp)

Example:
public ScrollToRow(int rowNum)
{
        this.GridVScrolled(this, 
                new ScrollEventArgs(ScrollEventType.LargeIncrement,
rowNum));
}

Eric C. Willman

-----Original Message-----
From: Unmoderated discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Young
Sent: Wednesday, October 13, 2004 10:45 AM
To: [EMAIL PROTECTED]
Subject: [ADVANCED-DOTNET] how to programmatically set scroll bar in the
datagrid?

Hi there,

Supposed I want to set the initial V scroll bar to a certain row in the
datagrid, how to do it?

thanks, Young

===================================
This list is hosted by DevelopMentor(r)  http://www.develop.com
Some .NET courses you may be interested in:

Essential .NET: building applications and components with CSharp
August 30 - September 3, in Los Angeles
http://www.develop.com/courses/edotnet

View archives and manage your subscription(s) at
http://discuss.develop.com

===================================
This list is hosted by DevelopMentor�  http://www.develop.com
Some .NET courses you may be interested in:

Essential .NET: building applications and components with CSharp
August 30 - September 3, in Los Angeles
http://www.develop.com/courses/edotnet

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to