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.
Unfortunately, activation email could not send to your email. Please try again.

SfDataGrid scrollviewer once at the bottom start scrolling on parent control if it has a scrollviewer

Thread ID:

Created:

Updated:

Platform:

Replies:

132145 Aug 16,2017 09:56 AM Aug 21,2017 12:25 AM UWP 3
loading
Tags: SfDataGrid
Alexandru Pastor Opris
Asked On August 16, 2017 09:56 AM

Hello,

We've been trying to implement a extra function to the datagrid that once the scrollbar is at the end and we keep scrolling down then the scrollbar should scroll the parent control instead of itself, as it's at the end there's no reason to keep scrolling down.

Is there any possible way to do this? Or can this be a new feature request for the datagrid? Thanks.

Have a nice day,
Alexandru.

Balamurugan Rajaraman [Syncfusion]
Replied On August 18, 2017 12:03 AM

Hi Alexandru, 
 
Thanks for contacting Syncfusion support 
 
We have checked your query “How to scroll the parent when the SfDataGrid vertical scroll bar reaches the end”. You can able to achieve your requirement by the below mentioned workaround, Kindly modify your application as like the below code snippet to meet your requirement. 
 
private  void VScrollBar_ValueChanged(object sender, EventArgs e) 
        { 
            if(((Syncfusion.UI.Xaml.ScrollAxis.ScrollInfo)sender).Value >= (((Syncfusion.UI.Xaml.ScrollAxis.ScrollInfo)sender).Maximum - DataGrid3.GetVisualContainer().ViewportHeight)) 
            { 
                var parentElement=FindDescendant(DataGrid3,typeof(ScrollViewer)); 
                (parentElement as ScrollViewer).ScrollToVerticalOffset((parentElement as ScrollViewer).VerticalOffset + 10); 
            } 
            if(((Syncfusion.UI.Xaml.ScrollAxis.ScrollInfo)sender).Value <= ((Syncfusion.UI.Xaml.ScrollAxis.ScrollInfo)sender).Minimum) 
            { 
                var parentElement = FindDescendant(DataGrid3, typeof(ScrollViewer)); 
                (parentElement as ScrollViewer).ScrollToVerticalOffset((parentElement as ScrollViewer).VerticalOffset-10); 
            } 
        } 
 
We have created the sample based upon your requirement and attached that sample for your reference you can able to get it from the below link. 
 
 
Regards, 
Balamurugan R 
  


Alexandru Pastor Opris
Replied On August 18, 2017 04:16 AM

Hello Balamurugan Rajaraman,


Thank you for the reply, I didn't get it to work as I've intended originally but after some tweaking with the code I got it working. I've attached a zip with the datagrid scrolling the parent once is at the end, and if we keep scrolling down, it'll keep scrolling the parent, before it just did the -10 / +10 offset of height on the parent and that's it.


Best regards and thank you again.

Alexandru.


Attachment: DataGridScrollParent_d536c02f.zip

Balamurugan Rajaraman [Syncfusion]
Replied On August 21, 2017 12:25 AM

Hi Alexandru, 
 
Thanks for the update. 
 
Please let us know if you need any further assist on this. 
 
Regards, 
Balamurugan R 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;