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

Set programmatically the scrolling on a GridView

2 Answers 80 Views
GridView
This is a migrated thread and some comments may be shown as answers.
dav
Top achievements
Rank 1
dav asked on 20 Feb 2009, 09:11 AM
I need to set programmatically the scroll of a GridView by code.

I can set the value of the scrollbars of my GridView by code. Unfortunatly the content of the grid doesn't scroll automatically if I change the value of the scrollbar.

Here the code to obtain and set the value of the scrollbars of your GridView:

GridViewItemsControl gridViewItemsControl = (GridViewItemsControl)RadGridView1.Template.FindName("PART_RootItemsControl", RadGridView1);

GridViewScrollViewer scrollviewer = (GridViewScrollViewer)gridViewItemsControl.Template.FindName("PART_ItemsScrollViewer", gridViewItemsControl);

ScrollBar verticalscrollbar = (ScrollBar)scrollviewer.Template.FindName("PART_VerticalScrollBar", scrollviewer);
ScrollBar horizontalscrollbar = (ScrollBar)scrollviewer.Template.FindName("PART_HorizontalScrollBar", scrollviewer);

horizontalscrollbar.Value = horizontalscrollbar.Maximum;
verticalscrollbar.Value = verticalscrollbar.Maximum;

Now how can I set the vertical/horizontal offset of the GridView 's content ?

Thanks,
Davide

2 Answers, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 20 Feb 2009, 01:58 PM
Hello dav,

Your question has beed addressed in ticket #192039.
I have attached a sample application that demostrates how users can scroll using our API.


All the best,
Milan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
dav
Top achievements
Rank 1
answered on 23 Feb 2009, 11:25 AM
Thanks, Milan.
Tags
GridView
Asked by
dav
Top achievements
Rank 1
Answers by
Milan
Telerik team
dav
Top achievements
Rank 1
Share this question
or