Posted 6 June 2018, 9:24 pm EST
Hi.
When I use C1TreeView, set AllowDragDrop = “False” and I pick an item, C1TreeView still has the orange border like I can drag that item? Do you have any ideals to make the orange border disappear?
Thank you!
Forums Home / ComponentOne / WPF Edition
Posted by: doremon1381 on 6 June 2018, 9:24 pm EST
Posted 6 June 2018, 9:24 pm EST
Hi.
When I use C1TreeView, set AllowDragDrop = “False” and I pick an item, C1TreeView still has the orange border like I can drag that item? Do you have any ideals to make the orange border disappear?
Thank you!
Posted 7 June 2018, 3:08 pm EST
Hello,
Try using C1DragDropManager in conjunction with C1TreeView. It has DragStart event which allows/prevent dragging the source by setting its e.Effect. Appending the following code to your application should resolve the issue for you:```
public MainWindow()
{
InitializeComponent();
C1DragDropManager _dragDropMng = new C1DragDropManager();
_dragDropMng.RegisterDragSource(SampleTreeView, DragDropEffect.None, ModifierKeys.None,true);
_dragDropMng.DragStart += Ddm_DragStart;
}
private void Ddm_DragStart(object source, DragDropEventArgs e)
{
e.Effect = DragDropEffect.None;
}
Thanks,
Ruchir Agarwal
[zip filename="C1TreeView_DragDrop.zip"]https://gccontent.blob.core.windows.net/forum-uploads/file-6b7c46ca-c49b-4958-b02c-1f07415aed36.zip[/zip]
Posted 7 June 2018, 6:36 pm EST
Thank you!
Posted 10 July 2018, 1:48 pm EST
Hello. @Ruchir.Agarwal
When i run your sample . Error as shown below. Wait for your feedback.
Posted 10 July 2018, 4:37 pm EST
Hi,
Though, using the application attached in my earlier response over this thread and dragging items, I could not see the exception at my end. However, I am aware of one such issue that you have mentioned, which is sporadic in nature, so I can understand that the issue might be happening there for you.
Also, I am happy to let you know that this issue has been fixed in the latest version released recently. You can verify the same by either updating ComponentOne using C1Live ‘C:\Program Files (x86)\ComponentOne\C1Live’ or using the following link to download the build:
http://prerelease.componentone.com/dotnet40/c1wpflibrary/2018-t2/C1WPFBasicLibrary.4_4.0.20182.595.zip
Also, I attached a standard Drag drop application with this response, for this purpose.
Thanks,
Ruchir AgarwalC1TreeViewStandardDragDrop.zip