To have the VerticalScrollBar always visible?

Hi,

For SfDataGrid, can we make the verticallScrollBar always visible?

I tried the following 2 ways but not really working

1. To have a ScrollViewer to contain the SfDataGrid

<ScrollViewer VerticalScrollBarVisibility="Visible">
   <syncfusion:SfDataGrid.......>
</ScrollViwer>
For this method, it is true that we can make the VerticalScrollBar always visible, however, it turns out that we can't use the mousewheel to scroll the datagrid.

2. Get the ScrollView inside the SfDataGrid.

I tried to get the ScrollView of the DataGrid with the following piece of code
var scrollView = (ScrollViewer)GridUtil.FindDescendantChildByType(dataGrid, typeof(ScrollViewer));

However, it seems that the scrollViewer doesn't always exist

1 Reply

FP Farjana Parveen Ayubb Syncfusion Team August 18, 2014 12:31 PM UTC

Hi Antony,

 

Thank you for contacting Syncfusion Support.

 

We analyzed your query. We can’t use the SfDataGrid inside the ScrollViewer. You can achieve your requirement by using ScrollViewer inside the SfDataGrid.

Please refer the below code example and sample in the following location:

 

Code Snippet:

    <syncfusion:SfDataGrid x:Name="sfdatagrid" Grid.Row="0"

                               AutoGenerateColumns="True"

                               AllowFiltering="True"

                               AutoGenerateRelations="True"

                               ScrollViewer.VerticalScrollBarVisibility="Visible"

                               ItemsSource="{Binding Path=Products}"

                               ColumnSizer="Star" />

 

Regards,

Farjana Parveen A


Attachment: SfDataGrid_VerticalScrolling_e315948a.zip

Loader.
Up arrow icon