We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

GridTreeControl Seems to Steal Focus

Thread ID:

Created:

Updated:

Platform:

Replies:

114929 Dec 13,2013 05:35 PM Dec 18,2013 05:33 AM WPF 1
loading
Tags: GridControl
Joshua Cauble
Asked On December 13, 2013 05:35 PM

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.


Shakul Hameed M [Syncfusion]
Replied On December 18, 2013 05:33 AM

Hi Joshua,

 

Thanks for contacting Syncfusion.

 

We have analyzed your query and we can achieve your requirement by setting the owner for the form loaded.

Please refer the following code snippet.

 

Code Snippet:[C#]

if (VM.SelectedRecord != null)

            {

                MyNewForm frm = new MyNewForm();

                frm.Owner = this;

                frm.Show();            

            }   

 

 

I have prepared the sample based on your requirement and please find the  attached sample.

 

Please let us know, if you have any query.

 

Thanks,

Shakul Hameed




Focus_ce3ee913.zip

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;