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

Row double click

5 Answers 111 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Sergey
Top achievements
Rank 1
Sergey asked on 11 Oct 2013, 06:08 AM
Hello. I have a problem with row double click. I use next code:

protected override void OnMouseDoubleClick(MouseButtonEventArgs e)
        {
            var element = InputHitTest(e.GetPosition(GetRowForItem(SelectedItem)));
            if (element != null)
            {
                if (DoubleClickCommand != null && DoubleClickCommand.CanExecute(DoubleClickCommandParameter))
                    DoubleClickCommand.Execute(DoubleClickCommandParameter);
            }
                 
            base.OnMouseDoubleClick(e);
        }

And some times InputHitTest return null. I can see that it happens when I scroll (Horizontal) to the right to the columns which aren't located in visible area. But if I resize gridView and some new columns will be located in visible area, InputHitTest will return right value. (My visual tree = RadDocumentPane -> ScrollViewer -> Canvas -> ContentControl -> RadGridView) Thanks.

5 Answers, 1 is accepted

Sort by
0
Nick
Telerik team
answered on 11 Oct 2013, 08:59 AM
Hello Sergey,

May I ask you to share a bit more information about your scenario. 
The logic you have shared is placed in an override of the MouseDoubleClick method. Have you inherited from the GridView elements? Are there any customizations on the controls and is there any reason why you can't use the args.Source property to get the source element? 

Thank you in advance! 

Regards,
Nik
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Sergey
Top achievements
Rank 1
answered on 20 Oct 2013, 04:06 PM
Hello.

Yes, I inherited (OlbGridView) from the RadGridView and I can't use Source property because it always equals "OlbGridView".
Thanks.
0
Nick
Telerik team
answered on 23 Oct 2013, 12:52 PM
Hi Segey,

Unfortunately, if that is the case, we cannot say what exactly goes wrong with the scenario. 
May I ask you to prepare a small project where we can observe the problem and send it, so we can debug it on our side and see what goes wrong exactly?

Thank you in advance! 

Regards,
Nik
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Sergey
Top achievements
Rank 1
answered on 13 Nov 2013, 12:08 PM
Hello. I sent a test project. Scroll grid view to the invisible columns and do double click. Variable "element" will be null.
0
Nick
Telerik team
answered on 18 Nov 2013, 09:19 AM
Hi Sergey,

I am unable to reproduce the issue at my side. May I ask you to try this out with our latest binaries and see if the issue persist? 

Thank you in advance! 

Regards,
Nik
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
GridView
Asked by
Sergey
Top achievements
Rank 1
Answers by
Nick
Telerik team
Sergey
Top achievements
Rank 1
Share this question
or