No matter what I do it seems that the GridTreeControl steals focus.
What I'm doing is in the DoubleClick of the grid is the following:
Point p = e.GetPosition(this.myGrid);
var cell = this.myGrid.InternalGrid.PointToCellRowColumnIndexOutsideCells(p, false);
if (cell.RowIndex > 0 && cell.ColumnIndex > 0 && myGrid.InternalGrid != null)
{
GridTreeNode selNode = myGrid.InternalGrid.GetNodeAtRowIndex(cell.RowIndex);
if (selNode != null && selNode.Item is MyRecordData)
{
MyRecordData dfo = selNode.Item as MyRecordData;
if (dfo != null)
{
VM.SelectedRecord = dfo;
}
}
}
if (VM.SelectedRecord != null)
{
MyNewForm frm = new MyNewForm(VM.SelectedRecord);
frm.Show();
frm.Activate();
}
I am doing this as I may have to travers to find a parent node if a child is selected to get to the correct detail form. However for now I have kept it simple.
Whenever I doubleclick to open my form the form ALWAYS opens behind my current form. I have tried focus events, activate items, all kinds of settings on both forms and it always opens behind.
I cannot make this a dialog as they can double click on multiple records in the source screen and open the details for many records.
Any help? If I exectue from a button vs doubleclick it works fine. Every time. but double click just seems to steal the focus.
And while I have this issue in the WPF control I have seen it in previous versions of the grid control for winforms too, as far back as syncfusion version 5.
Thanks.