Hi Bhavani,
To handle the scrolling in SfDataGrid we have placed ScrollableContentViewer inside the SfDataGrid’s control template. So if you want to place the SfDataGrid inside another scroll viewer, you have to disable the Manipulation of the inner ScrollableContentPresenter which is placed inside the ScrollableContentViewer.
You can achieve that by using the following code snippet.
Code Snippet [C#]:
void dataGrid_Loaded(object sender, RoutedEventArgs e) { var dataGrid = sender as SfDataGrid; var scrollcontent = FindDescendant(dataGrid, typeof(ScrollableContentPresenter)) as ScrollableContentPresenter; scrollcontent.ManipulationMode = ManipulationModes.System; } |
We have created a simple sample to achieve this. Please refer the below sample.
Sample Link: SfDataGrid.zip
Please let us know if you need further assistance.
Regards,
Prakash S.
Hi Bhavani,
To handle the scrolling in SfDataGrid we have placed ScrollableContentViewer inside the SfDataGrid’s control template. So if you want to place the SfDataGrid inside another scroll viewer, you have to disable the Manipulation of the inner ScrollableContentPresenter which is placed inside the ScrollableContentViewer.
You can achieve that by using the following code snippet.
Code Snippet [C#]:
void dataGrid_Loaded(object sender, RoutedEventArgs e)
{
var dataGrid = sender as SfDataGrid;
var scrollcontent = FindDescendant(dataGrid, typeof(ScrollableContentPresenter)) as ScrollableContentPresenter;
scrollcontent.ManipulationMode = ManipulationModes.System;
}
We have created a simple sample to achieve this. Please refer the below sample.
Sample Link: SfDataGrid.zip
Please let us know if you need further assistance.
Regards,
Prakash S.
Hi Syed ,
Thank you for using Syncfusion products .
We are unable to retrieve the sample due to file lost in our server. We have prepared the sample based on the above requirement . Please find the sample from the below location
The ScrollableContentPresenter has been changed in our SfDataGrid’s template as ScrollViewer from the product version 11.3. If you have used after 11.2 you can overcome this scrolling issue by setting the ManipualtionMode as System in SfDataGrid . Please find the sample for this scenario from the below location .
Sample : http://www.syncfusion.com/downloads/support/directtrac/general/SfDataGrid_ScrollViewer86466736.zip
But it is not correct way to use SfDataGrid inside ScrollViewer, because its breaks some UI element rendering functionality while setting the ManipulationMode as “System” to SfDataGrid . Normally we should not load SfDataGrid inside ScrollViewer ,because SfDataGrid itself has its own ScrollViewer .If loading the SfDataGrid inside ScrollViewer, SfDataGrid will load fully and the focus can’t change to ScrollViewer control .
Please let us know if you have any other queries .
Regards,
Akila R