Hello,
I have two GridViews that are side by side and I need to drag a row from one into the other. I have commands that I've tested with buttons that successfully move an item from one grid to another.
Here is the scenario
I am building a custom control that shows a list of available options and allows you to select them. Once they are selected, they are moved out of one grid and placed in the other. The grids are both bound to a collection. One grid is bound to an available list of items, and the other is bound to a list of selected items.
When an Item is selected, it is removed from the available collection and placed into the selected collection.
Everything is working as it should, but I need to add drag and drop functionality to these grids to move the data back and forth between them. Are there any code samples that will show an example of how to do this? I'm not sure what I need to do to accomplish this.
Thanks
Josh
I have two GridViews that are side by side and I need to drag a row from one into the other. I have commands that I've tested with buttons that successfully move an item from one grid to another.
Here is the scenario
I am building a custom control that shows a list of available options and allows you to select them. Once they are selected, they are moved out of one grid and placed in the other. The grids are both bound to a collection. One grid is bound to an available list of items, and the other is bound to a list of selected items.
When an Item is selected, it is removed from the available collection and placed into the selected collection.
Everything is working as it should, but I need to add drag and drop functionality to these grids to move the data back and forth between them. Are there any code samples that will show an example of how to do this? I'm not sure what I need to do to accomplish this.
<
Style
TargetType
=
"telerik:GridViewRow"
x:Key
=
"draggedRowStyle"
>
<
Setter
Property
=
"telerik:DragDropManager.AllowDrag"
Value
=
"True"
/>
</
Style
>
<
telerik:RadGridView
x:Name
=
"AvailableGrid"
Grid.Column
=
"0"
Grid.Row
=
"1"
ItemsSource
=
"{TemplateBinding AvailableItems}"
AllowDrop
=
"True"
RowStyle
=
"{StaticResource draggedRowStyle}"
ShowGroupPanel
=
"False"
RowIndicatorVisibility
=
"Collapsed"
/>
<
telerik:RadGridView
x:Name
=
"SelectedGrid"
Grid.Column
=
"2"
Grid.Row
=
"1"
ItemsSource
=
"{TemplateBinding SelectedItems}"
AllowDrop
=
"True"
RowStyle
=
"{StaticResource draggedRowStyle}"
ShowGroupPanel
=
"False"
RowIndicatorVisibility
=
"Collapsed"
/>
Thanks
Josh