HighTechTalks DotNet Forums  

Programmatically scroll the datagrid

Dotnet Framework (Compact Framework) microsoft.public.dotnet.framework.compactframework


Discuss Programmatically scroll the datagrid in the Dotnet Framework (Compact Framework) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Kev Westwood
 
Posts: n/a

Default Programmatically scroll the datagrid - 09-24-2007 , 08:51 AM






How can you programmatically scroll the datagrid?

The standard framework datagrid has a protected member called GridVScrolled
which can be used to scroll the grid but it is not in the compact version.

Any ideas?

Thanks
Kevin



Reply With Quote
  #2  
Old   
Jeje1307@gmail.com
 
Posts: n/a

Default Re: Programmatically scroll the datagrid - 10-12-2007 , 06:10 AM






On 24 sep, 15:51, "Kev Westwood" <kev... (AT) davrich (DOT) co.uk> wrote:
Quote:
How can you programmatically scroll thedatagrid?

The standard frameworkdatagridhas a protected member called GridVScrolled
which can be used to scroll the grid but it is not in the compact version.

Any ideas?

Thanks
Kevin
Did you find a solution for that problem ?
I'm currently facing the same issue, so your help will be
appreciated...



Reply With Quote
  #3  
Old   
vijay
 
Posts: n/a

Default Re: Programmatically scroll the datagrid - 10-26-2007 , 03:14 AM



On Oct 12, 7:10 pm, Jeje1... (AT) gmail (DOT) com wrote:
Quote:
On 24 sep, 15:51, "Kev Westwood" <kev... (AT) davrich (DOT) co.uk> wrote:

How can you programmatically scroll thedatagrid?

The standard frameworkdatagridhas a protected member called GridVScrolled
which can be used to scroll the grid but it is not in the compact version.

Any ideas?

Thanks
Kevin

Did you find a solution for that problem ?
I'm currently facing the same issue, so your help will be
appreciated...
Set the Vertical scroll bar value to required row number.
here is the sample code. add validations as you required.

Class ScrollDataGrid
Inherits DataGrid
Dim fi As Reflection.FieldInfo

Public Function scrollto(ByVal ivalue As Integer) As Boolean
fi = Me.GetType().GetField("m_sbVert", BindingFlags.NonPublic
Or BindingFlags.GetField Or BindingFlags.Instance)
CType(fi.GetValue(Me), VScrollBar).Value = ivalue
Me.CurrentRowIndex = ivalue
End Function
End Class



Reply With Quote
  #4  
Old   
Javier Ferri
 
Posts: n/a

Default Re: Re: Programmatically scroll the datagrid - 12-01-2010 , 04:08 AM



hello, thanks for this code, but I have not been able to make it work in c#, could you translate this into this language, please?
Thanks

Quote:
On Monday, September 24, 2007 9:51 AM Kev Westwood wrote:

How can you programmatically scroll the datagrid?

The standard framework datagrid has a protected member called GridVScrolled
which can be used to scroll the grid but it is not in the compact version.

Any ideas?

Thanks
Kevin

Quote:
On Friday, October 12, 2007 7:10 AM Jeje130 wrote:

Did you find a solution for that problem ?
I am currently facing the same issue, so your help will be
appreciated...

Quote:
On Friday, October 26, 2007 4:14 AM vijay wrote:

On Oct 12, 7:10 pm, Jeje1... (AT) gmail (DOT) com wrote:

Set the Vertical scroll bar value to required row number.
here is the sample code. add validations as you required.

Class ScrollDataGrid
Inherits DataGrid
Dim fi As Reflection.FieldInfo

Public Function scrollto(ByVal ivalue As Integer) As Boolean
fi = Me.GetType().GetField("m_sbVert", BindingFlags.NonPublic
Or BindingFlags.GetField Or BindingFlags.Instance)
CType(fi.GetValue(Me), VScrollBar).Value = ivalue
Me.CurrentRowIndex = ivalue
End Function
End Class

Quote:
Submitted via EggHeadCafe
HTML5 And the Case of the Missing Browsers
http://www.eggheadcafe.com/tutorials/aspnet/f1d49041-7566-4c3a-9f4f-699513e1b66c/html5-and-the-case-of-the-missing-browsers.aspx

Reply With Quote
  #5  
Old   
Javier Ferri
 
Posts: n/a

Default Re: Re: Re: Programmatically scroll the datagrid - 12-01-2010 , 06:19 AM



Ya lo encontr?:


using System.Reflection;

....

class BaseGrid : DataGrid {



/// <summary>

/// Scrolls datagrid to the row.

/// </summary>

/// <param name="rowNum">The row num.</param>

public void ScrollToRow(int rowNum)

{

FieldInfo fi = this.GetType().GetField("m_sbVert", BindingFlags.NonPublic | BindingFlags.GetField | BindingFlags.Instance);

((VScrollBar)fi.GetValue(this)).Value = rowNum;

}



}

Fuente:
http://dukelupus.wordpress.com/2009/03/13/how-to-scroll-datagrid-programmatically-in-net-ce/

Submitted via EggHeadCafe
Product Review: HP USB 2.0 Docking Station
http://www.eggheadcafe.com/tutorials/aspnet/bc3270c4-1907-4535-b1da-1af9a67d2e7b/product-review-hp-usb-20-docking-station.aspx

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.