RadGridView can't set disable scrolling at RadGridView

2 posts, 0 answers
  1. Vitalii
    Vitalii avatar
    6 posts
    Member since:
    Feb 2012

    Posted 29 Oct 2015 Link to this post

    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>                      

  2. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    281 posts

    Posted 02 Nov 2015 Link to this post

    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 encounter such scenario before.

    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
  3. DevCraft banner
Back to Top