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

Grid horizontal scrollbar snaps to start

Hello,

It is possible to prevent horizontal grid scrollbar to snap to start after changing filter type ?


1) Setting scroller to the end of grid, then changing filter type


2) Then after filter type change horizontal scrollbar snaps to the start


1 Reply

TS Thavasianand Sankaranarayanan Syncfusion Team July 15, 2019 06:34 AM UTC

Hi Domantas, 

Thanks for contacting Syncfusion support. 

While changing the Grid filter settings dynamically we have refreshed the Grid header element which cause the scrollbar to set at initial position. However you can maintain the horizontal scroll position by setting the “scrollLeft” property of Grid scroll module. Please refer to the below code example and sample link for more information. 

[component.ts] 
public onChange(e: ChangeEventArgs): void { 
      var left =this.grid.scrollModule.content.scrollLeft// get the scroll position 
        this.grid.filterSettings.type = <FilterType>e.value; 
        this.grid.clearFiltering(); 
       setTimeout((e)=> {this.grid.scrollModule.content.scrollLeft = left;},25);  // setting the position 
    } 



Please get back to us if you need any further assistance on this. 

Regards, 
Thavasianand S. 


Loader.
Live Chat Icon For mobile
Up arrow icon