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

Drag & drop whith a xml structure

5 Answers 183 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Matthias Brühl
Top achievements
Rank 1
Matthias Brühl asked on 10 Sep 2009, 05:19 PM
Hello,

we need drag & drop function from a datagrid to a listview, our structure is in xml.

Is this possible?

We have not found a possibility to do databinding with an xml structure,
nevertheless that's our criterion to buy this software,

thx for your help.

With regards,
Matthias

p.s. Can we customize the style/design of the several templates?

5 Answers, 1 is accepted

Sort by
0
Stefan Dobrev
Telerik team
answered on 14 Sep 2009, 12:35 PM
Hi Matthias,

The DragDrop will not try to modify collections or controls on its own, you will need to do this by handling the DragDrop events.

RadGridView supports binding to collections of XmlNodes. You can look at our online example here, which illustrates how to use XmlDataProvider as ItemsSource.

Only the DragDrop in the TreeView will try to modify its items source. Unfortunate the collections exposed as properties by the classes in the System.Xml namespace are read-only and non-observable.

Therefore you will need to handle the DragDrop events and use the respective methods on the Xml objects to modify them. Then, you will also need to refresh the items of the items controls because the collections that you bind to are not observable.

Do come back to us if you need more help on that.

Kind regards,
Stefan Dobrev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Matthias Brühl
Top achievements
Rank 1
answered on 14 Sep 2009, 04:38 PM
Hello Stefan,

thank you very much for your answer. We allready tried to handle the events and the corresponding XML data modifications on our own.
But we ran into some problems.
Right now we have a RadTreeView bind to XmlDataProvider. We implmented the necessary dragndrop handler.

RadDragAndDropManager.AddDragInfoHandler(radTreeView1, OnDragInfo); 
RadDragAndDropManager.AddDragQueryHandler(radTreeView1, OnDragQuery); 
RadDragAndDropManager.AddDropInfoHandler(radTreeView1, OnDropInfo); 
RadDragAndDropManager.AddDropQueryHandler(radTreeView1, OnDropQuery); 

Right now our problem is, that we dont know where to interrupt the event handling (on drop) so we do not run into the exception that our collection is read-only. it seems that we can´t interrupt the routed event and the treeview still wants to modify the source allthough read only.
e.Handled = true has no effect.
Could you please provide us an working example where we can see how to handle the described scenario.
Please respond as soon as possible, as time is running and we have to decide if we will buy your otherwise excellent suite.
We will have to make our decission within the next 24 hours.
Thank you very much for your help.

Best regards,
Matthias


0
Miroslav
Telerik team
answered on 17 Sep 2009, 03:16 PM
Hi Matthias,

I am sorry for the delayed reply, we were a little busier with the Beta 1 release of the controls, which is out now.

I realize now that my reply is past the 24 hour deadline that you had, but I hope that it will be helpful.

You can handle the TreeView's PreviewDragEnded event. This way the TreeView will not try to add/remove the XML elements from their nodes.

Then, you can handle the DropInfo event and check for the "DropComplete" e.Options.Status on the TreeView. Your xml data source should be the DataContext of the e.Options.Destination item. You will be able to retrieve it and add the items, which should be the payload of the DragDrop. The DropInfo event with status "DragComplete" needs also to be handled if you need to manually remove the payload from the e.Options.Source item.

Since the Xml elements are not observable, you may also like to call the itemsControl.Items.Refresh() of the parents of the affected nodes. This way the TreeView will update the representation as well.

I will copy my reply to your other thread as well.

Again, I am sorry for the delay, do not hesitate to contact us if you have more questions.

Kind regards,
Miroslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Matthias Brühl
Top achievements
Rank 1
answered on 21 Sep 2009, 12:20 PM
Hello Miroslav,

thank you for your reply,
it helped us very much

we are still evaluating as we fortunately got more time from our productmanagement.
As it seems, regarding to some other information in this forum, your current beta version adresses excactly our needs.
Therefor we would like to know, if there is a possibility to get the beta version.

 
Thanks in advance for your reply.

With best regards

Matthias Brühl



0
Nikolay
Telerik team
answered on 21 Sep 2009, 12:36 PM
Hello Matthias Brühl,

The Beta release is live now. You can find the Beta installation files under your account's Downloads section.

All the best,
Nick
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
DragAndDrop
Asked by
Matthias Brühl
Top achievements
Rank 1
Answers by
Stefan Dobrev
Telerik team
Matthias Brühl
Top achievements
Rank 1
Miroslav
Telerik team
Nikolay
Telerik team
Share this question
or