Respected Sir,
Problem's Objective:Drag and Drop a row and also multiple row from RadGridview to RadTreeView item .
Problem's Description : Well , i m having the RadgridView whose itemsource is binded with observableCollection and this GridView's itemsource changes according to TreeView Item selected. Now i m trying to achieve Draging the gridview's row to TreeView Item but i m not getting the same
I have viewed several post where by in Radgridview's xaml Drag and Drop Functionality for its row is set as below:
<
gridView:RadGridView AutoGenerateColumns="True" x:Name="gridView"
UseAlternateRowStyle="False" dragDrop:RadDragAndDropManager.AllowDrop="True"
Grid.Column="1" Margin="30">
<gridView:RadGridView.RowStyle>
<Style TargetType="gridViewElements:GridViewRow">
<Setter Property="dragDrop:RadDragAndDropManager.AllowDrag" Value="True" />
</Style>
</gridView:RadGridView.RowStyle>
</gridView:RadGridView>
I want above thing in programatic way in code bind file in c#.
Also i m not to get the visibilty of Draging the row... i have done following things
RadDragAndDropManager.AddDragQueryHandler(this.gvEmail, OnDragQuery);
RadDragAndDropManager.AddDragInfoHandler(this.gvEmail, OnDragInfo);
EventManager.RegisterClassHandler(typeof(GridViewRow), RadDragAndDropManager.DropQueryEvent, new EventHandler<DragDropQueryEventArgs>(OnGridViewRowDropQuery));
EventManager.RegisterClassHandler(typeof(GridViewRow), RadDragAndDropManager.DropInfoEvent, new EventHandler<DragDropEventArgs>(OnGridViewRowDropInfo));
void gvEmail_RowLoaded(object sender, RowLoadedEventArgs e)
{
if (e.Row is GridViewHeaderRow || e.Row is GridViewNewRow || e.Row is GridViewFooterRow)
return;
var row = e.Row as GridViewRow;
this.InitializeRowDragAndDrop(row);
}
private void InitializeRowDragAndDrop(GridViewRow row)
{
if (row == null)
return;
row.SetValue(
RadDragAndDropManager.AllowDragProperty, true);
//row.SetValue(RadDragAndDropManager.AllowDropProperty, true);
}
As i m newbie to the Telerik please give your valuable suggestions.
Thanks in advance.
Miral Shah