Drag an xml file into a treeview
-
Monday, October 25, 2010 12:31 PMCan an xml file be dragged and dropped into a treeview.If so can someone share the code for the above.
- Moved by CoolDadTxMVP Monday, October 25, 2010 1:52 PM Winforms related (From:Visual C# General)
All Replies
-
Friday, October 29, 2010 7:20 AMModerator
Hello Arun,
Is this a Windows Forms application, you can refer to : How to populate a TreeView control with XML data in Visual C# 2005 or in Visual C# .NET
If it is a WPF application,
http://blogs.msdn.com/b/jaimer/archive/2007/07/12/drag-drop-in-wpf-explained-end-to-end.aspx
http://stackoverflow.com/questions/1026179/drag-drop-in-treeview-wpfHope them help.
Best wishes,
Helen ZhouThis response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.- Marked As Answer by Jing0Moderator Monday, November 01, 2010 3:06 AM
- Unmarked As Answer by Arun Retheesan Thursday, November 11, 2010 9:56 AM
- Proposed As Answer by Cor LigthertMVP Thursday, November 11, 2010 10:05 AM
-
Thursday, November 11, 2010 9:58 AMI want to drag and view an xml in treeview just like we drag xml and view in visual studio
-
Thursday, November 11, 2010 10:04 AM
Hello Arun,
Is this a Windows Forms application, you can refer to : How to populate a TreeView control with XML data in Visual C# 2005 or in Visual C# .NET
If it is a WPF application,
Best wishes,
Helen Zhoud.
Helen, this is a windows form Forum so no WPF
:-)
Success
Cor -
Thursday, November 11, 2010 10:08 AM
I want to drag and view an xml in treeview just like we drag xml and view in visual studio
Arjun,
Yes than you need code, one is that what you got from Helen, and the other which she probably assumed was how to use the clipboard.
You cannot do this without creating code. You need the file part in this description .
http://msdn.microsoft.com/en-us/library/cy0hf43t(VS.90).aspx
And then use for instance the File ReadAllLines to get the XML
http://msdn.microsoft.com/en-us/library/ms143368.aspx
Success
Cor -
Thursday, November 11, 2010 10:11 AMyes i am talking about Windows form. How to populate a TreeView control with XML data in Visual C# 2005 or in Visual C# .NET only tells abt hw to read an xml file and show it in treeview. what i want is to Drag an xml file to a treeview, so isnt ther a need to write events for drag() , mouseenter etc etc.Info abt that is wat i require.


