This is a migrated thread and some comments may be shown as answers.

RadGridView can't set disable scrolling at RadGridView

1 Answer 523 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Vitalii
Top achievements
Rank 1
Vitalii asked on 29 Oct 2015, 08:14 PM

Hello telerik team,

 After reading your documentation about radgridview section scroling, I try disable scroll functionality at the grid, but I can't do that.

Could you please help me?

<telerik:RadGridView ItemsSource="{Binding MyItemsList}" telerik:ScrollingSettingsBehavior.IsEnabled="False">

    <telerik:RadGridView.Columns>
                                            <telerik:GridViewDataColumn Header="​header1" DataMemberBinding="{Binding ​item1}" Width="180" behaviours:RadGridViewSettings.CanHide="False"/>
                                            <telerik:GridViewDataColumn Header="​header2" DataMemberBinding="{Binding ​item2}"  Width="120"/>
                                            <telerik:GridViewDataColumn Header="header3" DataMemberBinding="{Binding item3}" Width="80"/>
                                            <telerik:GridViewDataColumn Header="header4" DataMemberBinding="{Binding item4}" Width="120"/>
                                        </telerik:RadGridView.Columns>
 </telerik:RadGridView>                      

1 Answer, 1 is accepted

Sort by
0
Stefan Nenchev
Telerik team
answered on 02 Nov 2015, 03:57 PM
Hello Vitalik,

I tried using the ScrollingSettingsBehavior.isEnabled property on my end and was not able to achieve the desired behavior as well. Could you elaborate on why you'd want to disable scrolling in the control, as we haven't such scenario

What I can suggest as a workaround is to set the IsHitTestVisible property of the RadGridView to false as per the following StackOverflow article - How to disable scrolling inside data grid in C#. Unfortunately, setting this property to false will not allow you to perform additional operations on the grid such as sorting, grouping, etc. I am adding a code snippet for your convenience, that also sets the Horizontal and Vertical ScrollBarVisibility to "Disabled" for better visualization: 

<telerik:RadGridView ItemsSource="{Binding MyItemsList}"
             IsHitTestVisible="False"
       ScrollViewer.HorizontalScrollBarVisibility="Disabled"
       ScrollViewer.VerticalScrollBarVisibility="Disabled">

I do realize that this approach has its flaws, but as I am not sure of your setup and the functionality you need to achieve, I decided it is a good suggestion.

Please, update me if the information was useful.

Regards,
Stefan Nenchev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
GridView
Asked by
Vitalii
Top achievements
Rank 1
Answers by
Stefan Nenchev
Telerik team
Share this question
or