How can you disable the Drag/Drop in GroupBar?
In our GroupBar control, we can disable the Drag/Drop by using the property "AllowDragandDrop". On disabling this property in GroupBar and GroupView, we cannot drag the items in that same.
For example the following code will demonstrate the “How can you disable the Drag/Drop in GroupBar?”
In this example, we have used “AllowDragandDrop” property to disable the Drag/Drop. This property used in GroupBar to disable the Drag/Drop of GroupBarItem and used in the GroupView to disable the Drag/Drop of GroupViewItem.
XAML
<syncfusion:GroupBar Height="300" Width="200" x:Name="MyGroupBar" AllowDragandDrop="False"> <syncfusion:GroupBarItem HeaderText="Mailbox" HeaderImageSource="/Images/mail.png"> <syncfusion:GroupView x:Name="mailboxgroupview" AllowDragandDrop="False" > <syncfusion:GroupViewItem Text="Inbox" ImageSource="/Images/inbox.png" /> <syncfusion:GroupViewItem Text="Outbox" ImageSource="/Images/Outbox.png" /> </syncfusion:GroupView> </syncfusion:GroupBarItem> <syncfusion:GroupBarItem HeaderText="Favorite Folders" HeaderImageSource="/Images/folder.gif" > <syncfusion:GroupView Name="favoritegroupview" AllowDragandDrop="False"> <syncfusion:GroupViewItem Text="Inbox" ImageSource="/Images/Inbox.png" /> <syncfusion:GroupViewItem Text="Unread Mail" ImageSource="/Images/trash.png"/> </syncfusion:GroupView> </syncfusion:GroupBarItem> </syncfusion:GroupBar>
C#
MyGroupBar.AllowDragandDrop = false; mailboxgroupview.AllowDragandDrop = false; favoritegroupview.AllowDragandDrop = false;
The below screen shot shows that we cannot drag GroupBarItem and GroupViewItem respectively
The below screen shot shows that items can be drag by default
Conclusion
I hope you enjoyed learning about how you can disable the Drag/Drop in GroupBar.
You can refer to our WPF Group Bar feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our WPF Group Bar example to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!