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

wpf listbox to gridview ViewModel

3 Answers 81 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 09 May 2011, 11:40 AM
I have the scenario where I have a listbox bound to a collection of viewmodels, from which I want to drag to a gridview, upon dropping they will be converted to a second ViewModel and added to the gridviews collection.

I would like to perform these actions in the overall viewmodel itself... the docs state:

Subscribe to the DropQuery and DropInfo events for gridview. You can do that in two ways. The first way is to subscribe in the XAML:

but im afraid im not familiar/smart enough to know what I need to code to subscribe these events to a method or command on the viewmodels?

In the meantime im coding it up with code behind, but I would really like to move these actions to the viewmodels

any help greatly appreciated

Michael

3 Answers, 1 is accepted

Sort by
0
Tsvyatko
Telerik team
answered on 09 May 2011, 11:46 AM
Hi Michael,

You might want to check this blogpost.
Let us know if you have any further questions of issues.

All the best,
Tsvyatko
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Michael
Top achievements
Rank 1
answered on 09 May 2011, 03:20 PM
Thank you...not sure why i couldnt get that when searching....

I also note that with my current implementation, I can no longer have the ability to drag/group by columns as it causes baddness in the whole drag drop scenario!??

0
Tsvyatko
Telerik team
answered on 10 May 2011, 07:33 AM
Hello Michael,

 Since, GridViewCells uses same infrastructure of RadDragAndDopManager, adding handlers on the RadGridView itself might interfere with the normal grouping behavior. To ensure that this logic is executed correctly the following code needs to be added in each Drag/Drop handler:

if (e.Options.Source is GridViewHeaderCell || e.Options.Source is GridViewGroupPanelCell)
{
        return;
}

All the best,
Tsvyatko
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
DragAndDrop
Asked by
Michael
Top achievements
Rank 1
Answers by
Tsvyatko
Telerik team
Michael
Top achievements
Rank 1
Share this question
or