RadCommandBar on touch device

1 Answer 103 Views
CommandBar
Kevin
Top achievements
Rank 1
Kevin asked on 20 Jan 2022, 01:37 PM

Hello,

I have an MDI parent form with a radcommandbar across the top.

The commandbar contains 2 commandstripelements which have several buttons

One is left justified and one is right justified

Everything is working fine except when I deploy it to a touch enabled / touchscreen client.  Some users are accidentally dragging the commandstripelements into one another and even dragging them off the command bar making them disappear entirely.

Is there a way to disable dragging or reordering of the commandstrips.   Ideally I don't want any of the items to move at all

I have already tried

For each commandstripelemnt I set

            commandBarStripElement1.AllowDrag = false;
            commandBarStripElement1.AllowDrop = false;
            commandBarStripElement1.EnableDragging = false;
            commandBarStripElement1.EnableFloating = false;

For each button in either strip element I set

buttonX.AllowDrag = false;

I even tried returning e.Canceled in BeginDrag

Nothing seems to be working 

Any help would be appreciated

 

Thanks

Kevin


 

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 21 Jan 2022, 06:40 AM

Hello, Kevin,

RadCommandBar supports rearranging at CommandBarStripElement level at runtime. You can enable or disable dragging at CommandBarStripElement level by setting the EnableDragging property. However, this affects only the dragging behavior by using the grip.

If you want to disable dragging with the pan gesture, you can use the following custom implementation for the CommandBarStripElement:

        public class CustomCommandBarStripElement: CommandBarStripElement
        {
            protected override Type ThemeEffectiveType
            {
                get
                {
                    return typeof(CommandBarStripElement);
                }
            }
            protected override void OnPanGesture(PanGestureEventArgs args)
            {
                //disable default logic
                //base.OnPanGesture(args);
            }
        }

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

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
CommandBar
Asked by
Kevin
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or