This is a migrated thread and some comments may be shown as answers.

Winform treeview questions

3 Answers 157 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
Johnny
Top achievements
Rank 2
Johnny asked on 14 Oct 2011, 08:54 AM
Hi all, i have questions about treeview in winform. Is it possible to integrate or combine explorer-like treeview to telerik treeview? I mean when the root folder/node is set to desktop directory, then it would auto generate all the childs and other nodes (which is folders/shortcut) inside the desktop.. Another question is how to make drag n drop function that copy the folder/node and not move it to the other treeview?

Sorry if I ask many questions here, I am a lil' bit beginner to this thing and hope you all can guide me. Thanx for your coorperation.

Regards,

Muz
 

3 Answers, 1 is accepted

Sort by
0
Julian Benkov
Telerik team
answered on 18 Oct 2011, 02:55 PM
Hi Johnny,

1) To show and process your 'Desktop' data, you can use different binding methods implemented in RadTreeView control. Please review our online documentation (binding section) for details and choose one that is suitable for your application.

2) To learn how to setup and use Drag & Drop operation between RadTreeView controls, you can take a look at our Demo application, RadTreeView >> Drag & Drop section. In addition, you can read the Enable Drag and Drop article in our online documentation.

I hope this helps. Do not hesitate to contact us if you have further questions or issues.

Kind regards,
Julian Benkov
the Telerik team

Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

0
Johnny
Top achievements
Rank 2
answered on 03 Nov 2011, 03:47 AM
Thanks for your reply. I've done my treeview with explorer function (desktop as root node and my computer, my documents, and all files/folders/shortcuts in desktop as childs). The missing nodes are my network places, recycle bin etc. Could you or anyone guide me how to implement my network places, recycle bin nodes into my treeview explorer. Sample codes is much appreciated.

Another things I stuck is how to disable copy/clone node to it own radtreeview. FYI my project consist of 2 radtreeviews and node can be drag and drop between them to copy the file and folder. But the project would be much better if I can set restriction only other treeview could receive the node. So my question is how I could achieved that and any help is much appreciated.
0
Julian Benkov
Telerik team
answered on 07 Nov 2011, 10:35 AM
Hello Johnny, 

1) For shell manipulationions regarding the file system, network and Recycle Bin you can use these articles in Codeproject:
2) To disable the Drag and Drop operation for your scenariom you can use DragOverNode event of RadTreeView control. Here is a simple example:
void radTreeView1_DragOverNode(object sender, Telerik.WinControls.UI.RadTreeViewDragCancelEventArgs e)
{
    if (e.TreeView == e.Node.TreeView)
    {
        e.Cancel = true;
    }
}

I hope this helps.

Best wishes,
Julian Benkov
the Telerik team

Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

Tags
Treeview
Asked by
Johnny
Top achievements
Rank 2
Answers by
Julian Benkov
Telerik team
Johnny
Top achievements
Rank 2
Share this question
or