Double Click event on Row of RadGridView

59 posts, 0 answers
  1. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 17 Nov 2011 Link to this post

    Hi Rob Ainscough,

    I created a small project illustrating the idea from this example. Still, the event is fired correctly for RadGridView in the RowDetails as well. Does this scenario correspond to yours ? Can you reproduce the same behavior on the attached project ? 
     

    Greetings,
    Maya
    the Telerik team

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

  2. HDC
    HDC avatar
    214 posts
    Member since:
    Dec 2010

    Posted 24 Dec 2011 Link to this post

    Does this still work in the latest build using SL5?

    I'm trying to use this demo code but it simply does not work in my application, the event does not get fired

    It's very frustrating that something so basic as double clicking a row in a grid is so difficult to do on the radgridview.


  3. DevCraft banner
  4. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 27 Dec 2011 Link to this post

    Hello Peter,

    Actually, we are aware of this issue and it has already been resolved. The fix will be available in our next internal build.
    Thank you for your feedback.

    Regards,
    Maya
    the Telerik team

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

  5. danparker276
    danparker276 avatar
    389 posts
    Member since:
    Aug 2010

    Posted 30 Dec 2011 Link to this post

    With the new double click feature in SL5, will there be another/better way to do this or added method?
  6. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 03 Jan 2012 Link to this post

    Hello Dan,

    Actually, the behavior of double click event and its usage should be the same as those for Silverlight 4.  

    All the best,
    Maya
    the Telerik team

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

  7. Prakash
    Prakash avatar
    19 posts
    Member since:
    Oct 2010

    Posted 10 Jan 2012 Link to this post

    I have added radgridview inside RadTreeView itemtemplate. I want to add double click event for gridview cell. Could you please give us a solution how to add double click event for a gridview which is in template?

    Thanks
    Prakash
  8. Rob Ainscough
    Rob Ainscough avatar
    172 posts
    Member since:
    Jan 2010

    Posted 14 Mar 2012 Link to this post

    Maya,

    I'm using RowActivated event for now, but it was my understanding that the Q1 2012 version for SL5 projects would have the DoubleClick event ... it doesn't appear to have any such event?

    Your demo code is interesting, but it does cause other problems requiring additional code and work arounds ... definitely not ideal for RAD (rapid application development).

    Is there any reason why you folks are not adding this feature since it clearly is something many of us want?

    Rob
  9. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 15 Mar 2012 Link to this post

    Hello Rob,

     The double click in Silverlight 5 is actually MouseLeftButtonDown + e.ClickCount. 

    Regards,
    Vlad
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  10. Rob Ainscough
    Rob Ainscough avatar
    172 posts
    Member since:
    Jan 2010

    Posted 16 Mar 2012 Link to this post

    Vlad,

    Thanks, didn't know that ... will look into using that.

    Rob.
  11. John
    John avatar
    4 posts
    Member since:
    Dec 2011

    Posted 09 Jul 2012 Link to this post

    Man, I looked everywhere and could not find any solutions in the forums. So I am posting it in every thread that asks how to catch the row double-click. It would be nice if Telerik made it easy to find. This is so simple.
    VB.Net
    Private Sub dgObjects_RowActivated(sender As System.Object, e As Telerik.Windows.Controls.GridView.RowEventArgs) Handles dgObjects.RowActivated
            If Not dgObjects.SelectedItem Is Nothing Then
                MessageBox.Show("test")
            End If
        End Sub
  12. HDC
    HDC avatar
    214 posts
    Member since:
    Dec 2010

    Posted 10 Jul 2012 Link to this post

    Hi John,

    I fail to see how this has anything, what so ever, to see with double click???

    Care to explain?

    Best Regards,

    Peter


  13. Chris
    Chris avatar
    4 posts
    Member since:
    Aug 2012

    Posted 15 Aug 2012 Link to this post

    PLEASE tell me te DataGridViewRow can now handle double click without haviong to resort to writing code like this!
  14. Chris
    Chris avatar
    4 posts
    Member since:
    Aug 2012

    Posted 15 Aug 2012 Link to this post

    For the love of Mike when is Telerik FINALLY going to address this issue!
  15. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 15 Aug 2012 Link to this post

    Hello Chris,

    It would be great if you specify your exact requirement and the scenario that you want to implement. Why working with RowActivated event is not appropriate for your ? What is the behavior that you want to get ?  

    All the best,
    Maya
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  16. Chris
    Chris avatar
    4 posts
    Member since:
    Aug 2012

    Posted 15 Aug 2012 Link to this post

    What we need, what everyone on this thread needs, what I've been waiting two years for is a .RowDoubleClick event handler.
    I've been promised time and again "this is coming". What is taking so long?
    I know frustration but this is getting rediculous.
  17. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 15 Aug 2012 Link to this post

    Hi,

    I might be missing something here, but why following any of the suggestions above is not suitable for you ? You can work with RowActivated event, CellDoubleClick, MouseLeftButtonDown + e.ClickCount. Could you clarify what is the scenario that you want to accomplish, but still cannot with any of those approaches ? 

    Kind regards,
    Maya
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  18. Rob Ainscough
    Rob Ainscough avatar
    172 posts
    Member since:
    Jan 2010

    Posted 15 Aug 2012 Link to this post

    Hi Maya,

    Problem with RowActivated is that if the row is already activated, then no event fires, so then we have to add code to deal with that situation.  For many of us that buy/subscribe to 3rd party tools is so that our work load is reduced.  I share Chris's frustration, but I also realize there is not much point in doing more work (by Telerik) on a technology that has ended it's life and the new "fad" is HTML5.

    SL5 is better (solves more end user problems) than HTML5 but neither are as good as Windows Forms in terms of ease of application development and ROI.  The biggest problem with SL5 is that much of it doesn't have adequate documenation (including you folks on your products).  Why I mention this on a "DoubleClick" event is because there are developers such as myself that don't have the time and we expect 3rd party tools to save us time, not increase our time.  In fact, the entire point of 3rd party tools is to save time and accomplish tasks that we would have to code ourselves.  Rather than a company hirings a programmer to do exclusive UI work we buy 3rd party tools, such as Telerik ... it's much more cost effective.

    Sooo, when we see what we consider basic features missing and have to keep coding work arounds or adding more complex code to deal with a situation we feel we paid for in a 3rd party tool, it gets frustrating.

    I'd even venture to guess that the smaller the company the more likely they'll look at 3rd party tools ... and those tools need to help us get things done faster.  And lets face it, when it comes to code bloat SL is certainly a top 10 for excessive code.  But there again, many products from Microsoft seem to be focused on endless layers of abstraction, to the point where it's so difficult to manage the abstraction where one small change can cause massive application wide bugs ... I diverge ... but I've been around for a while (30+ years) and today's application development seems to be more a game of who can abstract the most and get less actual work done.  Technologies change so frequently that all the effort that's gone into re-use and abstraction is nullified (wasted even) ... just like SL ending.

    Anyway, I realize it's unlikely we'll see a RowDoubleClick, but I can appreciate the need for one.

    Rob



  19. Mark Jakes
    Mark Jakes avatar
    27 posts
    Member since:
    Feb 2010

    Posted 15 Aug 2012 Link to this post


    Hello Rob/Chris and everyone else who is ranting...

    Here's how I send the double click to my view model (using MVVM Light). 

    This works on an already selected row/column mentioned in a previous post and it's easy to implement.

    public ViewDashboard()
    {
        InitializeComponent();
        this.radgridview1.AddHandler(GridViewCellBase.CellDoubleClickEvent, new EventHandler<RadRoutedEventArgs>(OnCellDoubleClick), true);
    }
     
    private void OnCellDoubleClick(object sender, RadRoutedEventArgs e)
    {
       if (e.OriginalSource.GetType() == typeof(GridViewCell))
       {
           AppMessages.GridDoubleClickEvent.send(e);
       }
    }

    It's not a workaround, it is using the tools that have been given.

    If you are driving a car and your sat nav sends you the wrong way, you have a choice.  

    1. Find another way or
    2. Sit in the car, bash the steering wheel, kick the dog and and scream at passers by.

    I choose to implement a solution and move on!  

    No offence intended of course, but I fail to see why a developer wouldn't implement such a simple solution.   If something better comes along then great, but since posting to this thread over a year ago I am astonished it is still going!

    Here to help and happy to.

    Mark.

    PS: Screaming at the wife often helps!
  20. Chris
    Chris avatar
    4 posts
    Member since:
    Aug 2012

    Posted 15 Aug 2012 Link to this post

    Someday Mark you may understand...
    Telerik as always please implement a .RowDoubleClick as soon as it can be included in a release. We plan to use Silverlight for sometime and will move to another technology when it matures. The RadGridView improvements for SL5 have been HUGE so thank you for making those available.
    HELP!!!
  21. Rob Ainscough
    Rob Ainscough avatar
    172 posts
    Member since:
    Jan 2010

    Posted 15 Aug 2012 Link to this post

    Mark,

    You forgot option #3 

        Fix the Nav so it doesn't send you to the wrong place

    ;)

    Would love to know what "AppMessages" is about ... can't find any info on it and doesn't intellisense anywhere in my code??

    Telerik folks are doing a good job, they just need some improvements to help use customers/developers get things done quickly.

    Rob 

  22. Mark Jakes
    Mark Jakes avatar
    27 posts
    Member since:
    Feb 2010

    Posted 15 Aug 2012 Link to this post


    Hi Rob

    Yes, fix the Sat Nav, but screaming at passers by releases some tension.  :-)

    AppMessages is part of MVVM-Light (http://mvvmlight.codeplex.com/) and allows me (and you, should you implement it) to separate code from design.  Highly recommended if you are working in a team where designers are involved.

    I add the handler in the constructor and when it is fired, I pass 'RadRoutedEventArgs e' to my ViewModel and check for e.ClickCount to determine if a double click was raised by the UI.  You don't have to do it this way of course, you can check for e.ClickCount in your code behind and act on it as normal.

    Hope that helps, but I can elaborate if you want me to.

    Regards

    Mark

    PS: Chris..  I am not sure what you are getting at by your reply.  I am not part of Telerik, just a fan, so I can't magic a solution for you apart from what has been suggested in previous posts.  Happy to help though if I can.
  23. danparker276
    danparker276 avatar
    389 posts
    Member since:
    Aug 2010

    Posted 15 Aug 2012 Link to this post

    Why don't you put a request in on the issue tracker?  I doubt it would get many votes, but it also seems like it's something that would be easy to implement.  There are many other SL/WPF things I'd rather see done first though.
  24. Rob Ainscough
    Rob Ainscough avatar
    172 posts
    Member since:
    Jan 2010

    Posted 16 Aug 2012 Link to this post

    Hey Mark,

    Think you're being a little dramatic, I'm not screaming at anyone.  I've implemented a solution that works for me.  I'm not in a position to set Telerik feature "priority" -- I don't have access to their customer data for feature improvements so I have no idea what is or isn't important.

    Given the age of this thread, it is somewhat surprising that no such feature has been implemented, but NOT too surprising.  SL is dead (in the sense it has no future upgrade path) and I'm sure Telerik are moving resources to HTML5 ... so I agree, it's unlikely we'll ever see a RowDoubleClick implementation.

    I don't use MVVM, tried it, but found it too slow on the end user side, it was "pretty" on the development side, but my end users take priority.  MVVM just wasn't good on ROI and didn't really provide any benefit to my end users/clients.  I'm sure Mr. Martin Fowler had good intentions with MVC but my real world  has demonstrated that for a truely good and fast application the designer (View side) has to get involved in the ViewModel (logic) because there are pratical performance limits.  The basic premise that the user interface changes frequently really does NOT apply, in fact, most of my end users/client would MUCH RATHER the interface NOT change ... so implementing MVVM would be like building a Space Shuttle to go from your house to the grocery store ... when a simple cheap car will do :) 

    A good example of where MVVM would introduce a big performance hit ... suppose you define a UserControl that has a Button - Stack Panel - Image - TextBlock.  You add some DependencyProperties to my UserControl to support a User access (security) ... say a User Logs in and their access rights are define by an EventType and an EventID (extracted from a database) ... make these a part of the UserControl.  EventType and EventID are values used to match up with whatever the User has access to ... if the user has a record in a database with matching EventType and EventID the UserControl IsEnabled.  In order to make this follow MVVM, the UserControl needs to be able to support IsEnabled (View) which is set by a return value from a web service (Model) that matches User, EventType, and EventID (ViewModel).   If I have 40 instances of these UserControls on my Page then I have to make 40 individual web service calls IF I truely want to maintain MVVM ... web services are slow, just one more layer to getting data to an application (much slower than if it were possible to use SqlClient directly which you can't do in SL).  Not doing the MVVM route, I could simply make ONE web service call that gathers up all the approprite data for the User for all 40 UserControls, cycle thru that data and match up each UserControl and set IsEnabled.  This IS a much faster process but IS NOT MVVM.

    As you know, web services are NOT fast (any time you add a layer, you slow things down) and they are Asynchronous which may seem great but more often than not other Controls need to wait for the population of one control before they can gather up the data they need which may also be waiting on by another control.

    I diverge ... sorry.

    Rob
  25. danparker276
    danparker276 avatar
    389 posts
    Member since:
    Aug 2010

    Posted 16 Aug 2012 Link to this post

    Thank you for your MVVM Rob. "make ONE web service call that gathers up all the approprite data"  That's exactly what I do and I don't use MVVM.  I think it's better to spend time unit testing the web services, than unit testing the view model which might not catch all the UI errors anyway.  I really don't see the advantage of re-using the view model either.  I'd rather just add the whole control as a link or in a class library.  I don't really care about the performance hit, MVVM is just extra code and extra files.

    As for Silverlight being dead and them not putting priority on it.  Even if that was the case, the controls and development are almost the same for WPF, and the windows 8 RT Metro or whatever you call it now.  Siliverlight is to be supported until 2021 or 2022 at least.  For me it's easier to install Silverlight than WPF business applications that can't be HTML.  Maybe I should make them all WPF since I always use Out of Browser mode, but I think the install/updates are just easier with Silverlight (I could be wrong).
  26. Rob Ainscough
    Rob Ainscough avatar
    172 posts
    Member since:
    Jan 2010

    Posted 16 Aug 2012 Link to this post

    Same here, I run OOB as it has SO many advantages from elevated trust (almost full access to local storage not just restricted to the My Folders) to a faster UI ... but OOB's key is that it REMOVES THE BROWSER.  This is HUGE step forward for our support department ... NOT having to deal with all the browser variances and settings that can and do cause issues with non-OOB SL.  Too bad Microsoft terminated SL developement, it was just starting to mature as a product and become very useful for business applications.

    Anyway, maybe Microsoft will see the light ... who knows, maybe it'll come back as GoldRays v1.0 ;)

    HTML5 is a step backwards in terms of what it can do compared to SL5 ... but HTML5 lives in the "sandbox" and that's all Microsoft seem to care about.  I guess the dream of having "grown-up" enterprise applications running on any OS and not in a browser is still just that ... a dream :(.  It does boggle my mind that in this day and age we still can't do this because of fear.  It's probably what 99.9% of enterprise developers want, yet we're stuck with kiddy sandbox applications and HTML5.

    Rob.
  27. danparker276
    danparker276 avatar
    389 posts
    Member since:
    Aug 2010

    Posted 16 Aug 2012 Link to this post

    I have to use printers and scanners and HTML 5 isn't an option for that.  Nor is telling people they have to use IE with the latest direct X plug in.  Flash screwed things up for client side with their constant updates.  There's not much more MS really needs to update after Silverlight 5 though.  I can accomplish everything I need to now.  It's just too bad more platforms don't support it.  Luckily I can tell my users to use windows.
  28. ADM-IT Denis Pujdak
    ADM-IT Denis Pujdak avatar
    34 posts
    Member since:
    Sep 2011

    Posted 31 Jul 2013 Link to this post


    <UserControl x:Class="MyProject.View.SilverlightControl1"
        mc:Ignorable="d"
        d:DesignHeight="400" d:DesignWidth="600">
         
        <Grid x:Name="LayoutRoot" Background="White">
     
            <telerik:RadGridView ItemsSource="{Binding MyItems}">
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="RowActivated">
                        <i:InvokeCommandAction Command="{Binding OpenItemCommand}"/>
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </telerik:RadGridView>
     
        </Grid>
         
    </UserControl>

    namespace MyProject.ViewModel

    {


    public
    class MyItems : ObservableCollection<MyItem>
    {
        // .....
    }
     
    public class MyItem : ViewModelBase
    {
        // .....
     
        public RelayCommand OpenItemCommand
        {
            get
            {
                return new RelayCommand(OpenItemCommandExecute);
            }
        }
     
        public void OpenItemCommandExecute()
        {
            // to do anything
        }
    }
    ....


  29. Hrishikesh
    Hrishikesh avatar
    6 posts
    Member since:
    Dec 2015

    Posted 21 Dec 2015 Link to this post

    How to Display selected row from radgridview to RadTextBox in vb.net 2010?

    Pls help...?

    See attached Screenshot...!

     

  30. Richard
    Richard avatar
    1 posts
    Member since:
    Jan 2016

    Posted 18 Nov Link to this post

    If you're using MVVM, you would probably prefer to attach an ICommand, which will be passed the DataContext of the row that has been clicked on, as a parameter. I've just posted how to do that here.
Back to Top
DevCraft banner