This is a migrated thread and some comments may be shown as answers.
Q3 RadGridView MouseLeftButtonDown
4 Answers 94 Views
This is a migrated thread and some comments may be shown as answers.
Marcus Lambert
Top achievements
Rank 1
Marcus Lambert asked on 30 Nov 2009, 05:44 PM
Hi,
MouseLeftButtonDown dosent seem to be working the way I would expect. It only seem to fire if no rows/cells are in the Grid. Once there are cells or rows it does not fire.

I dont want to attach events at a cell or row level as I am trying to use MVVM and thus wish to Bind to a delegatecommand in my view model.

Marcus

4 Answers, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 03 Dec 2009, 03:36 PM
Hello Marcus Lambert,

As of Q3  MouseUp/MouseDown events are handled by RadGridView and for the time being the only way to listen for those events is to subscribe using code. For example:

using Telerik.Windows.Input;
...
Mouse.AddMouseDownHandler(element, OnMouseDown, true);
...
private void OnMouseDown(object sender, Telerik.Windows.Input.MouseButtonEventArgs args)
{
      
}

Depending on your scenario it is not mandatory to subscribe for mouse events on all rows or cells. Subscribing for those events of RadGridView only might do the job. Could you please provide more information about your scenario so that we could try to provide an acceptable solution.

We have just recently introduced the AddMouseDownHandler with three argument where the last one allows you to handle already handled events. The new method is available in our latest internal build.

We are also evaluating several ideas on how we can improve the current situation with event handling and we will try to provide better experience as soon as possible 

Best wishes,

Milan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Marcus Lambert
Top achievements
Rank 1
answered on 03 Dec 2009, 08:10 PM

Hi

Thanks for the reply, it has helped some what.
What I was wanting to do is hook up a row "double click" to a command in my VM.
Ideally I would like to do this all in Xaml


Marcus


0
Milan
Telerik team
answered on 04 Dec 2009, 01:55 PM

Hello Marcus Lambert,

I am afraid that it would be impossible to wire the command using XAML due to the internal event handling.

Would it be possible to handle the events using code and manually invoke the command of your View Model? For example:

private void OnMouseDown(object sender, Telerik.Windows.Input.MouseButtonEventArgs args) 
      // double click
      if(args.ClickCount >= 2) 
      {
         // execute my ViewModel command
      }
}

We are sorry for this inconvenience.


Sincerely yours,
Milan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Gili
Top achievements
Rank 1
answered on 25 Feb 2013, 07:36 AM
how can i determine if the mouse click was on one of the grid's cells or on the scroll bar?
Asked by
Marcus Lambert
Top achievements
Rank 1
Answers by
Milan
Telerik team
Marcus Lambert
Top achievements
Rank 1
Gili
Top achievements
Rank 1
Share this question
or