views:

207

answers:

0

Hello,

I have two XamDataGrids setup as treeviews.

I am dragging and dropping from one to the other.

I am only allowing one to have records deleted.

But when you delete a record from one, it gets deleted from the other.

I have tryed to clone the object, but I cannot find any method of doing so through out the datagrid's members.

    private void dgRight_Drop(object sender, DragEventArgs e)
    {
        XamDataGrid dragSource = dgLeft;
        XamDataGrid dragTarget = sender as XamDataGrid;

        //Get Instance of the dragger DataRecordPresenter and DataRecord
        DataRecordPresenter draggedPresenter = e.Data.GetData(typeof(DataRecordPresenter)) as DataRecordPresenter;
        DataRecord draggedRecord = draggedPresenter.Record as DataRecord;

        dragTarget.DataItems.Add(draggedRecord.DataItem);
    }

How do we copy the DataItem over without it being tied to the source?

If this is not possible, what is the best method of dragging items from one grid to the other, while allowing only one to have items deleted without affecting the source?

Thanks,

-Tom.