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

DoubleClick support

35 Answers 716 Views
GridView
This is a migrated thread and some comments may be shown as answers.
om
Top achievements
Rank 1
om asked on 23 Jan 2009, 08:18 PM
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

35 Answers, 1 is accepted

Sort by
0
Valentin.Stoychev
Telerik team
answered on 27 Jan 2009, 03:28 PM
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.
0
om
Top achievements
Rank 1
answered on 27 Jan 2009, 06:34 PM
Thanks alot for your reply Valentin.
0
Rogério
Top achievements
Rank 1
answered on 07 Apr 2009, 02:51 PM
Hello Valentin,

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

Thanks.

Regards,
Rogério
0
Valentin.Stoychev
Telerik team
answered on 07 Apr 2009, 03:13 PM
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.
0
Rogério
Top achievements
Rank 1
answered on 07 Apr 2009, 03:41 PM
Hello again,

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

Thanks.

Regards,
Rogério
0
Valentin.Stoychev
Telerik team
answered on 08 Apr 2009, 06:50 AM
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.
0
Rogério
Top achievements
Rank 1
answered on 08 Apr 2009, 07:13 AM
Hello,

Thanks for the information!

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

Regards,
Rogério
0
Stephen
Top achievements
Rank 1
answered on 23 Apr 2009, 04:24 PM
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
0
Vlad
Telerik team
answered on 24 Apr 2009, 05:59 AM
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.
0
Paolo
Top achievements
Rank 1
answered on 03 Jul 2009, 09:51 AM
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
0
Accepted
Rossen Hristov
Telerik team
answered on 03 Jul 2009, 01:52 PM
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.
0
Paolo
Top achievements
Rank 1
answered on 03 Jul 2009, 02:40 PM
Hi Ross,
it works perfectly!
many thanks!!!

Paolo
0
Carlos
Top achievements
Rank 1
answered on 14 Jul 2010, 11:24 PM

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!!
0
Vlad
Telerik team
answered on 15 Jul 2010, 07:00 AM
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
0
Carlos
Top achievements
Rank 1
answered on 15 Jul 2010, 07:35 PM
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
0
Vlad
Telerik team
answered on 16 Jul 2010, 06:39 AM
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
0
Carlos
Top achievements
Rank 1
answered on 20 Jul 2010, 07:47 PM
Same error. I tried in three different computers, with the same error. Nobody else is reporting this?
0
Milan
Telerik team
answered on 21 Jul 2010, 05:48 AM
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
0
Carlos
Top achievements
Rank 1
answered on 21 Jul 2010, 07:52 PM
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.


0
Milan
Telerik team
answered on 22 Jul 2010, 12:17 PM
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
0
Carlos
Top achievements
Rank 1
answered on 23 Jul 2010, 10:44 PM

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

            }

        }

0
Ludovic Gerbault
Top achievements
Rank 1
answered on 27 Jul 2010, 05:44 PM
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 ?
0
Vlad
Telerik team
answered on 28 Jul 2010, 06:42 AM
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
0
Salvador
Top achievements
Rank 1
answered on 23 Sep 2010, 10:21 PM
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.

0
Milan
Telerik team
answered on 28 Sep 2010, 10:51 AM
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
0
Brian
Top achievements
Rank 2
answered on 14 Feb 2011, 09:45 PM
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.
0
Maya
Telerik team
answered on 15 Feb 2011, 06:38 PM
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>>
0
Chris
Top achievements
Rank 1
answered on 27 Apr 2011, 05:02 PM
Has DoubleClick been added to the supported events list?
0
Milan
Telerik team
answered on 28 Apr 2011, 06:43 AM
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
0
Chris
Top achievements
Rank 1
answered on 28 Apr 2011, 12:17 PM
I need to be able to trap double click versus single click on a row.
This basic ability should already be there!
HELP!!!!
0
Maya
Telerik team
answered on 28 Apr 2011, 12:49 PM
Hello Chris,

May you provide a bit more information on your requirements ? Why subscribing to the RowActivated event, CellDoubleClickEvent or using an attached behavior are not appropriate for your scenario ?
Generally, all three approaches will enable you to handle the case when a mouse is double-clicked.

Best wishes,
Maya
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
0
Chris
Top achievements
Rank 1
answered on 28 Apr 2011, 12:52 PM
We need to be able to select multiple rows and invoke a context menu (right click) to perform an operation on the multiple rows AND double click to select a single row and perform an action.

This is a complex issue. Can I talk to someone?
0
Maya
Telerik team
answered on 28 Apr 2011, 01:27 PM
Hi Chris,

Firstly, if you want to be able to select multiple items, you may set the SelectionMode property of the grid to "Multiple" or "Extended". As for defining and using a ContextMenu, you may take a look at our online demos for further reference.
Considering your requirement for selecting an item on double-click, you may cancel the built-in selection during the SelectionChanging event, handle the CellDoubleClickEvent for example and select the corresponding items. 
Still, I would recommend you using the default way a selection is performed, as otherwise you will probably have to consider the cases when you are selecting multiple items. 

All the best,
Maya
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
0
Rajini Jayaseelan
Top achievements
Rank 1
answered on 12 Jul 2012, 10:02 AM
I use "RadControls for Silverlight Q2 2012", has the event been removed or an alternative approach is in place, pls assist. I have attached the list of methods available and onmousedoubleclick is not available.
0
Maya
Telerik team
answered on 12 Jul 2012, 10:51 AM
Hello Rajini,

The event is at GridViewCellBase level as illustrated in our demos.  

Greetings,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
om
Top achievements
Rank 1
Answers by
Valentin.Stoychev
Telerik team
om
Top achievements
Rank 1
Rogério
Top achievements
Rank 1
Stephen
Top achievements
Rank 1
Vlad
Telerik team
Paolo
Top achievements
Rank 1
Rossen Hristov
Telerik team
Carlos
Top achievements
Rank 1
Milan
Telerik team
Ludovic Gerbault
Top achievements
Rank 1
Salvador
Top achievements
Rank 1
Brian
Top achievements
Rank 2
Maya
Telerik team
Chris
Top achievements
Rank 1
Rajini Jayaseelan
Top achievements
Rank 1
Share this question
or