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

Drag and Drop functionality between two RadGridView using two instance of same application

0 Answers 19 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Laxman asked on 13 Mar 2013, 05:55 AM
Hi Support Team,

I am facing an issue while dragging a row from source RadGridView which is in separate window (different instance of same application) and dropping it in target RadGridView which is in separate  window (different instnace of the same application). I have implemented like following but I am getting an exception which is following.  But if I drag text from textbox and drop into RadGridView instead of using GridRow as source it works fine. Please help is to resolve this issue.

"Error HRESULT E_FAIL has been returned from a call to a COM component."

App.xaml file contents are following:
<Application x:Class="DragAndDropWPFApp.App"






<Style TargetType="telerik:GridViewRow">

<Setter Property="telerik:RadDragAndDropManager.AllowDrag" Value="True"></Setter>

<Setter Property="telerik:RadDragAndDropManager.AutoDrag" Value="True"></Setter>



I have two RadGridViews in the xaml windows which names are following:
1. rgvSource
2. rgvTarget

Code in the code behind file is following for DragOver Event.

private void rgvSource_DragOver(object sender, DragEventArgs e)
            RadGridView grid = (RadGridView)sender;
            GridViewRow row = (GridViewRow)this.rgvSource.ItemContainerGenerator.ContainerFromItem(this.rgvSource.SelectedItem);
            User user = row.Item as User;
            string data = user.Id.ToString() + "," + user.UserName + "," + user.LastLoginDate.ToShortDateString();   
            DragDrop.DoDragDrop(rgvSource, data , DragDropEffects.Copy);


Dropped Grid event is following


 private void rgvTarget_DragEnter(object sender, DragEventArgs e)
            if (e.Data.GetDataPresent(DataFormats.Text))
                e.Effects = DragDropEffects.Copy;
                e.Effects = DragDropEffects.None;  

        private void rgvTarget_Drop(object sender, DragEventArgs e)
so how to resolve Com expection?

Hope someone will help me out to resolve this issue. Its urgent.








No answers yet. Maybe you can help?

Asked by
Top achievements
Rank 1
Share this question