DoubleClick support

36 posts, 1 answers
  1. om
    om avatar
    26 posts
    Member since:
    Jan 2009

    Posted 23 Jan 2009 Link to this post

    Hi,
    Is there any way to capture double click on the cell especially when cell is not in edit mode? I know there is no such event in current GridView, but is it something that we can expect in your Q1 release? I was just thinking about it because this is a functionality very widely used in regular asp.net grid through javascript and this functionality is not available in silverlight DataGrid aswell. And at the same time we need this functionality.
    Since we are using someother telerik controls and are really happy with them and also considering to use Telerik control aswell, which will depend on the distinct features we will get from telerik GridView.
    I will be very glad if we could get the functioanlity of double click from RadGrid.

    Would love to know your thoughts about this issue?

    Best Regards
    Osama
  2. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 27 Jan 2009 Link to this post

    Hello Osama ,

    Yes - we are working on that. This will be available in the next version.

    Best wishes,
    Valentin.Stoychev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. DevCraft banner
  4. om
    om avatar
    26 posts
    Member since:
    Jan 2009

    Posted 27 Jan 2009 Link to this post

    Thanks alot for your reply Valentin.
  5. Rogério
    Rogério avatar
    33 posts
    Member since:
    Feb 2009

    Posted 07 Apr 2009 Link to this post

    Hello Valentin,

    Is this feature (or something similar) implemented on Telerik Q1 2009 package?

    Thanks.

    Regards,
    Rogério
  6. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 07 Apr 2009 Link to this post

    Hi Rogério,

    Yes - it is - give it a try and let us know if you hit any problems.

    Sincerely yours,
    Valentin.Stoychev
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  7. Rogério
    Rogério avatar
    33 posts
    Member since:
    Feb 2009

    Posted 07 Apr 2009 Link to this post

    Hello again,

    Could you tell me what's the event that I must subscribe?

    Thanks.

    Regards,
    Rogério
  8. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 08 Apr 2009 Link to this post

    Hello Rogério,

    The event is called "MouseDoubleClick", and is a member of the GridViewCell class.

    You can use it by attaching a class handler like that:

    RadGridView1.AddHandler(GridViewCell.MouseDoubleClickEvent, new EventHandler<RadRoutedEventArgs>(this.OnCellDoubleClick));

     

    private void OnCellDoubleClick(object sender, RadRoutedEventArgs e)
    {
    /// your logic here    ...
    }

     

     

    Please let us know if you have any other questions.

    Best wishes,
    Valentin.Stoychev
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  9. Rogério
    Rogério avatar
    33 posts
    Member since:
    Feb 2009

    Posted 08 Apr 2009 Link to this post

    Hello,

    Thanks for the information!

    It seams to work fine! I'll let you know if I found any issue!

    Regards,
    Rogério
  10. Stephen
    Stephen avatar
    2 posts
    Member since:
    Apr 2009

    Posted 23 Apr 2009 Link to this post

    Sorry for being a bit dumb, but I cannot find the AddHandler method on the GridView at the instance or class level.
    Am I missing something?

    Thanks
    Steve
  11. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 24 Apr 2009 Link to this post

    Hello Stephen,

    AddHandler is extension method and you need to register Telerik.Windows namespace.

    Greetings,
    Vlad
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  12. Paolo
    Paolo avatar
    9 posts
    Member since:
    May 2009

    Posted 03 Jul 2009 Link to this post

    Hi,
    I try to add handler in VB.NET but I receive an error...
    this is the code:

    [MyGrid is a RadGridView]

    MyGrid.AddHandler(Telerik.Windows.Controls.GridView.GridViewCell.MouseDoubleClickEvent, System.Delegate.CreateDelegate(GetType(System.EventHandler), MyGrid, "OnDoubleClickCellaGrigliaListino"))

    and

    Public Delegate Sub OnDoubleClickCellaGrigliaListinoHandler(ByVal sender As Object, ByVal e As RadRoutedEventArgs)

        Public Sub OnDoubleClickCellaGrigliaListino(ByVal sender As Object, ByVal e As RadRoutedEventArgs)
            ... my logic here
        End Sub

    what's wrong?
    Thanks
    Paolo
  13. Answer
    Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 03 Jul 2009 Link to this post

    Hi Paolo,

    Try with this:

        Public Sub New() 
            InitializeComponent() 
     
            Me.MyGrid.[AddHandler](GridViewCell.MouseDoubleClickEvent, _ 
                                    New EventHandler(Of RadRoutedEventArgs)(AddressOf Me.OnDoubleClickCellaGrigliaListino)) 
            Me.MyGrid.ItemsSource = GetMessages() 
        End Sub 
     
        Public Sub OnDoubleClickCellaGrigliaListino(ByVal sender As ObjectByVal e As RadRoutedEventArgs) 
            ' your logic here 
        End Sub 
     

    I have attached a small sample project. I hope it helps.

    Regards,
    Ross
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  14. Paolo
    Paolo avatar
    9 posts
    Member since:
    May 2009

    Posted 03 Jul 2009 Link to this post

    Hi Ross,
    it works perfectly!
    many thanks!!!

    Paolo
  15. Carlos
    Carlos avatar
    5 posts
    Member since:
    Jul 2009

    Posted 14 Jul 2010 Link to this post


    Hello Ross,

    Would it be possible for you to post the same solution in C#?

    I keep getting 'Argument type 'Telerik.Windows.RoutedEvent' is not assignable to parameter type 'System.Windows.RoutedEvent'
    when trying to add the handler in C# syntax.

    Thanks!!
  16. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 15 Jul 2010 Link to this post

    Hello Carlos,

     Please check this demo for more info about double click. 

    Regards,
    Vlad
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  17. Carlos
    Carlos avatar
    5 posts
    Member since:
    Jul 2009

    Posted 15 Jul 2010 Link to this post

    I am getting the following error when visiting the demo:
    ---------------------------
    Could not load file or assembly 'Telerik.Windows.Controls.Input, Version=2010.2.714.1040, Culture=neutral, PublicKeyToken=5803cfa389c90ce7' or one of its dependencies. The requested assembly version conflicts with what is already bound in the app domain or specified in the manifest. (Exception from HRESULT: 0x80131053)
    --------
    It get stuck after reaching 100
  18. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 16 Jul 2010 Link to this post

    Hello,

    Have you tried to clear your browser cache?

    Best wishes,
    Vlad
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  19. Carlos
    Carlos avatar
    5 posts
    Member since:
    Jul 2009

    Posted 20 Jul 2010 Link to this post

    Same error. I tried in three different computers, with the same error. Nobody else is reporting this?
  20. Milan
    Admin
    Milan avatar
    1989 posts

    Posted 21 Jul 2010 Link to this post

    Hello Carlos Marquez,

    What kind of browser is being used? Could you please try to run the demos with another browser?


    Kind regards,
    Milan
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  21. Carlos
    Carlos avatar
    5 posts
    Member since:
    Jul 2009

    Posted 21 Jul 2010 Link to this post

    Tried in IE8.0.7600.16385, Chrome 5.0.375.99 & Firefox 3.6.6. All running in Windows 7 64 bit

    I also tried in XP 32 bit, in a 'brand new' virtual machine. I was redirected to install the latest Silverlight and some web development tools.

    Same error.


  22. Milan
    Admin
    Milan avatar
    1989 posts

    Posted 22 Jul 2010 Link to this post

    Hello Carlos,

    Well, it seems that this is a caching problem but the strangest thing is that, as you have said, clearing the browser cache does not help. What I could suggest is to download our installation package which will install our demos on your local machine and you should be able to view them.


    Regards,
    Milan
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  23. Carlos
    Carlos avatar
    5 posts
    Member since:
    Jul 2009

    Posted 23 Jul 2010 Link to this post

    I think the company proxy must be caching something. I was able to see the demo from home. These are the steps that I followed to subscribe to the doubleclick in the grid. It works. Thank you!

    In the code-behind class:

    1) Inherit class from

           INotifyPropertyChanged

     

    2) Add 
          public event PropertyChangedEventHandler PropertyChanged;

     

    3) After InitializeComponent() is called add

           YourNamedRadGridView.AddHandler(GridViewCellBase.CellDoubleClickEvent, new EventHandler<RadRoutedEventArgs>(OnCellDoubleClick), true);

     


    4) Finally add the event handler:

            private void OnCellDoubleClick(object sender, RadRoutedEventArgs args) {

                GridViewCellBase cell = args.OriginalSource as GridViewCellBase;

                if (cell != null) {

                  //RUN CODE FOR DOUBLE CLICK HERE

                }

            }

  24. Ludovic Gerbault
    Ludovic Gerbault avatar
    226 posts
    Member since:
    Apr 2009

    Posted 27 Jul 2010 Link to this post

    Hello

    I have a strange behaviour implementing the CellDoubleClickEvent that I didn't had before

    It seems that the code reacting to a double click event is also being fired by a left click then right click combination if it's being done quick enough

    It's a bother for me since I have implemented a function on double click event (the primary function) and other secondary functions on a context menu on each row.

    When my users go to select a row (right click) then display the context menu (left click), it triggers the default action of double click event.

    Any ideas ?
  25. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 28 Jul 2010 Link to this post

    Hello,

     Why not use RowActivated instead? Please check this demo for more info. 

    Kind regards,
    Vlad
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  26. Salvador
    Salvador avatar
    4 posts
    Member since:
    Sep 2010

    Posted 23 Sep 2010 Link to this post

    Hello,
    This example is very good and works fine. Just a little question, Is possible AddHandler in XAML? 

    This is the code to do in code behin 
    this.RadGridView1.AddHandler(GridViewCellBase.CellDoubleClickEvent, new EventHandler<RadRoutedEventArgs>(OnCellDoubleClick), true);
    I want to do the same but in the XMAL.

    Thank you.

  27. Milan
    Admin
    Milan avatar
    1989 posts

    Posted 28 Sep 2010 Link to this post

    Hello Salvador,

    I am afraid that in this particular instance it is not possible to subscribe to this event in XAML.


    Sincerely yours,
    Milan
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  28. Brian
    Brian avatar
    8 posts
    Member since:
    Oct 2008

    Posted 14 Feb 2011 Link to this post

    You could create a custom behavior ( : Behavior<RadGridView>), expose a double click command (ICommand) and then bind that to your model using just XAML. See this post for an example:

    http://www.dansoltesz.com/post/2010/02/19/Silverlight-datagrid-double-click-behavior.aspx

    Not telerik specific, but the pattern applies to any control.
  29. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 15 Feb 2011 Link to this post

    Hi,

    I am sending you yet another sample project illustrating how you may handle double-clicking creating a custom behavior.

     
    All the best,
    Maya
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  30. Chris
    Chris avatar
    26 posts
    Member since:
    Jul 2010

    Posted 27 Apr 2011 Link to this post

    Has DoubleClick been added to the supported events list?
  31. Milan
    Admin
    Milan avatar
    1989 posts

    Posted 28 Apr 2011 Link to this post

    Hello Chris,

    Such event is still not available but you might consider using RowActivated event which is demonstrated on this demo

    Hope it helps. 


    Best wishes,
    Milan
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top
DevCraft banner