From: Dr_Franz on
Hello,
I want to copy a DataRow from a Custom DataGridView to another custom
DataGridView.
The destination dgv is in a custom control.
When I close the form after moving a Row, i have this exception:
"'Child' is not a child control of this parent"
the exception does not occur when I move the row while clicking on the row
header, but only when I move it while clicking on one of the cells.
Can anybody help me?

Thanks.
From: joe on
i recently had this same issue where my datagrid was throwing that same
exception when dispose() was called.

the issue turned out to be a situation where the grid has a non-null tooltip
that also doesn't have a handle in the DataGridViewToolTip.Activate()
function. This is called from DataGridView.AssignParent(null); (when your
parent form is removing the DataGrid's parent). This function looks like:

internal override void AssignParent(Control value)
{
if (this.toolTipControl.Activated)
{
this.toolTipControl.Activate(false);
}
base.AssignParent(value);
}

I assume this is a bug. To get rid of the issue in my application I simply
set DataGridView.ShowCellToolTips = false in the Form_Load() event.
Hopefully this solution will work for you as well. If, however, you need
tool tips maybe you can set tool tips to false in the Closing event? Not
sure.

Anyways, good luck.

joe

"Dr_Franz" wrote:

> Hello,
> I want to copy a DataRow from a Custom DataGridView to another custom
> DataGridView.
> The destination dgv is in a custom control.
> When I close the form after moving a Row, i have this exception:
> "'Child' is not a child control of this parent"
> the exception does not occur when I move the row while clicking on the row
> header, but only when I move it while clicking on one of the cells.
> Can anybody help me?
>
> Thanks.