Q3 RadGridView MouseLeftButtonDown

5 posts, 0 answers
  1. Marcus Lambert
    Marcus Lambert avatar
    41 posts
    Member since:
    Aug 2009

    Posted 30 Nov 2009 Link to this post

    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
  2. Milan
    Admin
    Milan avatar
    1989 posts

    Posted 03 Dec 2009 Link to this post

    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.
  3. DevCraft banner
  4. Marcus Lambert
    Marcus Lambert avatar
    41 posts
    Member since:
    Aug 2009

    Posted 03 Dec 2009 Link to this post

    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


  5. Milan
    Admin
    Milan avatar
    1989 posts

    Posted 04 Dec 2009 Link to this post

    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.
  6. Gili
    Gili avatar
    14 posts
    Member since:
    Jan 2013

    Posted 25 Feb 2013 Link to this post

    how can i determine if the mouse click was on one of the grid's cells or on the scroll bar?
Back to Top
DevCraft banner