This is a migrated thread and some comments may be shown as answers.
Disable Scrolling for Panning in Grid
4 Answers 4 Views
This is a migrated thread and some comments may be shown as answers.
Alan
Top achievements
Rank 1
Alan asked on 03 Nov 2020, 01:10 AM

Hi, How can I disable grid scrolling associated with a panning gesture? I would like it just to work when using the grid's scrollbar. So, while a user is panning, e.g. panning vertically up, I do not want the grid to scroll.

Thanks!

4 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Sr.
Telerik team
answered on 03 Nov 2020, 06:10 AM

Hi, Alan,

Please set the RadGridView.EnableGestures property to false. In addition, make sure that the EnableKineticScrolling property is also set to false. Thus, you wouldn't scroll the view with moving the mouse with left button down.

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Alan
Top achievements
Rank 1
answered on 03 Nov 2020, 04:54 PM

Thanks for the reply! I need to handle panning but in a different way, other than scrolling. So, it needs to be enabled as a gesture. Is there a way  to disassociate scrolling from the panning or to override the behavior that panning has on the grid?

Thanks again!

Alan

0
Accepted
Dess | Tech Support Engineer, Sr.
Telerik team
answered on 04 Nov 2020, 02:13 PM
Hello, Alan, 

If the pan gesture is enabled and you want to plug into the default logic, first make sure that the EnableKineticScrolling property is set to false. Thus, you will prevent the scrolling.

Then, you can create a derivative of RadGridView and override its OnPanGesture method. There, you can introduce the desired logic you need.

An alternative approach is to create a custom TableViewDefinition and override its CreateViewUIElement method where you can replace the default GridTableElement with a custom one: 
        public class CustomTableViewDefinition : TableViewDefinition
        {
            public override IRowView CreateViewUIElement(GridViewInfo viewInfo)
            {
                return new CustomGridTableElement();
            }
        }

        public class CustomGridTableElement : GridTableElement
        {
            protected override Type ThemeEffectiveType     
            { 
                get    
                { 
                    return typeof(GridTableElement);     
                }
            }
             
            protected override void OnPanGesture(PanGestureEventArgs args)
            {
                //TODO
                base.OnPanGesture(args);
            }
        }
Then, in the Designer.cs file replace the default TableViewDefinition with your custom one.

Should you have further questions please let me know.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Alan
Top achievements
Rank 1
answered on 10 Nov 2020, 04:41 PM

Thank you Dess! That worked!

Alan

Asked by
Alan
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Sr.
Telerik team
Alan
Top achievements
Rank 1
Share this question
or