We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Scroll to top

Hi ,

I was just wandering is there any way I could "scroll to top" row of my choice?
ScrollIntoView just isn't enough for what I need right now.
Can anyone anyone help me with this one?

Thank you.

3 Replies

GM Gobikrishnan Murugesan Syncfusion Team May 14, 2015 12:27 PM UTC

Hi Sarma,
Thank you for using Syncfusion products.
We analyzed your queryand you can achieve “scroll to top” by using ScrollInView() method also.For you reference we have shared a code snippetas follows:
Code Snippet:
this.syncgrid.ScrollInView(newRowColumnIndex(0,0));
If your scenario about ScrollToTop is different from above one, please share some more information about your requirementasthis would be helpful forus toprovideabetter solution.
Thanks,
Gobikrishnan M​



SA Sarma May 15, 2015 04:09 PM UTC

Thank you for your reply,

but I have just now realized how unclear I was regarding this question...

So here the issue at hand:
- let's say I have 150 row in my datagrid
- my issue is to  have row index 55 set to Top of my datagrid
something like 
<pre>
this.syncgrid.ScrollToTop(new RowColumnIndex(55,0));
</pre>

ScrollInView method will move my records, but will not necessarily move my 55 record to the top of the datagrid.

Hope this makes it clearer now.


GM Gobikrishnan Murugesan Syncfusion Team May 18, 2015 10:34 AM UTC

Hi Sarma,


Thank you for your update.


We analyzed your query and you can achieve your requirement like “scroll to top” by using ScrollInView() method and ScrollLineIndex property. Please find the code snippet as follows :


Code Snippet:


//Scroll to particular row index

this.syncgrid.ScrollInView(new RowColumnIndex(RowIndex, 0));

//After scrolling, need to set corresponding row index as first visible index in view.

this.syncgrid.GetVisualContainer().ScrollRows.ScrollLineIndex = RowIndex;



We have also prepared the sample based on this and please find the sample under the following location:


http://www.syncfusion.com/downloads/support/forum/119127/simple_sfGrid_winrt-876981452.zip


Please let me know if this solution helps you.


Thanks,

Gobikrishnan M​


Loader.
Live Chat Icon For mobile
Up arrow icon