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

RadGridView scrolling

13 Answers 1205 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Shweta
Top achievements
Rank 1
Shweta asked on 07 Oct 2008, 12:02 PM
hi,

Can anyone guide me in how to change the scrolling position of the scoll bar of radGridView  by code behind. 

regards,
Shewta

13 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 08 Oct 2008, 05:54 PM
Hi Shweta,

You can scroll RadGridView programmatically. Just call RadGridView.GridElement.ScrollToRow() method passing as a parameter either the index of the desired row, or the row itself:
this.radGridView1.GridElement.ScrollToRow(23); 

If you have additional questions, feel free to contact me.

Best wishes,
Nikolay
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Sudip Vidyarthi
Top achievements
Rank 1
answered on 17 Aug 2011, 08:27 AM
I am unable to scroll to last row smoothly...whenever a new row is added, the scroll bar seems at last position but actualy the data are of not reflecting properly whn updated
0
Svett
Telerik team
answered on 19 Aug 2011, 09:22 AM
Hi Sudip Vidyarthi,

Thanks for writing.

I am enclosing a sample project which demonstrates how you can scroll to the last row.

All the best,
Svett
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
OD
Top achievements
Rank 1
answered on 23 Apr 2013, 01:53 PM
I need to scroll row by row my gridview
Is there a way when i scroll in the end of the lines to see only the last rows ? (for example, when i am at the last row, i want to see only the last)

i don't know if you understand what i mean, i don't speak english very well ^^
0
Svett
Telerik team
answered on 24 Apr 2013, 12:42 PM
Hello Nermond,

If you want to perform scrolling row by row, you should change the ScrollMode of RowScoller in the following manner:
this.radGridView1.TableElement.RowScroller.ScrollMode = ItemScrollerScrollModes.Discrete;

If you want to see only one row at time in the RadGridView's viewport, you should change its height or shrink the RadGridView's height. You can change the height of all rows by using the following code snippet:
this.radGridView1.TableElement.RowHeight = 50;

I hope that you find this information useful.

Greetings,
Svett
the Telerik team
WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
0
OD
Top achievements
Rank 1
answered on 24 Apr 2013, 03:10 PM
super, i didn't know "Rowscroller" :)
In fact, what i need to do is an infinite smooth scroll in the gridview. After the last row, i want to see the first row again, etc....
you think there's a way ?
0
Svett
Telerik team
answered on 29 Apr 2013, 11:42 AM
Hi Nermond,

There is no way to achieve that. The scrolling in RadGridView is based on the virtualization engine. It is designed to process the rows sequentially until the last one is reached. There is no way to customize this approach.

Kind regards,
Svett
the Telerik team
WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
0
Developer
Top achievements
Rank 1
answered on 29 Jul 2014, 09:12 PM
[quote]Svett said:Hi Sudip Vidyarthi,

Thanks for writing.

I am enclosing a sample project which demonstrates how you can scroll to the last row.

All the best,
Svett
the Telerik team
 

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

 
[/quote]

This doesn't seem to work if I have added two SortDescriptors to my RadGridView. I suspect the row indexes don't get updated, so that the bottom row ends up not necessarily having the highest index value. Is it possible to programmatically scroll to bottom-most row after sorting has taken place?
0
Dimitar
Telerik team
answered on 01 Aug 2014, 12:34 PM
Hello Keith,

Thank you for writing.

The provided solution should work for all cases regardless of the rows order. Please note that the ChildRows collection should be used since the indexes in the Rows collection are not changed after the sorting operation. Nevertheless you can use a direct index as well:
this.radGridView1.TableElement.ScrollToRow(radGridView1.ChildRows.Count);

I hope this helps.

Regards,
Dimitar
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Developer
Top achievements
Rank 1
answered on 01 Aug 2014, 05:16 PM
[quote]Dimitar said:Hello Keith,

Thank you for writing.

The provided solution should work for all cases regardless of the rows order. Please note that the ChildRows collection should be used since the indexes in the Rows collection are not changed after the sorting operation. Nevertheless you can use a direct index as well:
this.radGridView1.TableElement.ScrollToRow(radGridView1.ChildRows.Count);

[/quote]

Thank You Dimitar,

But, wouldn't that just take the Count of ChildRows and scroll to the record whose index in Rows matches that count? If the indexes in Rows do not change, I don't think this gets around the issue. 

I have tried to do this.radGridView1.TableElement.ScrollToRow(radGridView1.ChildRows.Count - 1), since just using Count would be out of the zero-based index range. But, this is not scrolling all the way to the bottom.

I believe what I would need to do is to get the last element in ChildRows, and then lookup what that element's index would be in Rows, and use that integer as the parameter in this.radGridView1.TableElement.ScrollToRow(). Can you tell me if that is possible and how to go about it?

0
Dimitar
Telerik team
answered on 05 Aug 2014, 10:22 AM
Hi Keith,

Thank you for writing back.

This works as expected on my side. In addition the rows indexes in the ChildRows collection should be changed after the grid is sorted. More Information about this collection can be found here. This is why I want to kindly ask you to post a support ticket for this. There you should attach a sample project that reproduces the issue. You can specify the exact version of our controls that you are using as well. This will allow us to further investigate this case and provide you with a proper solution.

You can also include a reference to this forum thread.

Thank you in advance for your cooperation.

Regards,
Dimitar
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
paulo g
Top achievements
Rank 1
Veteran
answered on 12 Aug 2020, 11:34 PM

Hi

About "this.radGridView1.TableElement.ScrollToRow(radGridView1.ChildRows.Count);"

Has  radpivotgrid  got some similar functionallity?

 

Regards

Paulo

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 13 Aug 2020, 08:07 AM
Hello, Paulo,

The ScrollToRow method is relevant only for RadGridView. RadPivotGrid doesn't have such an equivalent.

The possibility that RadPivotGrid offers is to manage directly the value of the respective scrollbar in RadPivotGrid. Feel free to increase/decrease the Value property of the PivotGridElement.VScrollBar and PivotGridElement.HScrollBar.
 
I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Tags
GridView
Asked by
Shweta
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Sudip Vidyarthi
Top achievements
Rank 1
Svett
Telerik team
OD
Top achievements
Rank 1
Developer
Top achievements
Rank 1
Dimitar
Telerik team
paulo g
Top achievements
Rank 1
Veteran
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or