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

datagrid scrolling on tablet

Sample code below. Strange behavior.

On a tablet i am able to scroll by moving label up or down with my finger but cannot scroll by moving the datagrid. This way appears like datagrid is not touch sensitive. 

Strange behavior, while moving label and datagrid is still scrolling we can move the datagrid with finger but once the datagrid is not moving, we no longer able to move it with finger

Please advice
Thanks

<ScrollViewer>    
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="100"></ColumnDefinition>
            <ColumnDefinition></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition></RowDefinition>
            <RowDefinition></RowDefinition>
        </Grid.RowDefinitions>             
                <TextBlock Grid.Column="0" Grid.RowSpan="2" TextAlignment="Center" VerticalAlignment="Center" > This is text</TextBlock>                         
                <syncfusion:SfDataGrid x:Name="datagrid"
                               Grid.Column="1"
                               Grid.Row="0"
                               AutoGenerateColumns="True"
                               ColumnSizer="Star"
                               ItemsSource="{Binding Stocks}">
                </syncfusion:SfDataGrid>
            <syncfusion:SfDataGrid x:Name="datagrid1"
                               Grid.Column="1" Grid.Row="1"
                               AutoGenerateColumns="True"
                               ColumnSizer="Star"
                               ItemsSource="{Binding Stocks}">
            </syncfusion:SfDataGrid>
    </Grid>
</ScrollViewer>

note: refer http://www.syncfusion.com/uploads/user/forum/108293/MainPage.xaml.cs_739bcfab.zip for viewmodel or data

3 Replies

PS Prakash Selvaraj Syncfusion Team April 22, 2013 12:57 PM UTC

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.



SN Syed Najmuddin Asif replied to Prakash Selvaraj January 12, 2015 01:00 PM UTC

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 Prakash,

This is exactly my problem as well. I tried using your snippet but was getting an error with "FindDescendent". The attached solution by you is not available for download, if you can give me a correct path to download the zip file I can go through the code and fix the issue.

Thanks,
Syed Asif


AR Akila Rajaram Syncfusion Team January 30, 2015 10:17 AM UTC

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

 

Sample : http://www.syncfusion.com/downloads/support/directtrac/general/SfDataGrid_ScrollableContentPresenter176843103.zip

 

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

 


Loader.
Live Chat Icon For mobile
Up arrow icon