selecting rows in radgridview

4 posts, 0 answers
  1. PCI
    PCI avatar
    2 posts
    Member since:
    Jul 2014

    Posted 02 Jul 2014 Link to this post

    Is it possible to select grid rows using mouse click? I mean that if I click on row it will be select but other selected rows don't become unselected.
    It should behave like left click with ctrl click on keyboard.

    Second maybe related question: which event may override MouseLeftButtonUp or Down after click on row? If use MouseRightButtonUp it works fine but when use leftbutton event it doesn't work. I have there breakpoint and the program doesn't break.
  2. Yoan
    Admin
    Yoan avatar
    1215 posts

    Posted 02 Jul 2014 Link to this post

    Hello,

    Let me go straight to your questions:

    1. Do you want multiple selection? Please refer to the Multiple Selection help article. Moreover, you can check the Selection online demo. The same example is available in your local copy of WPF demos.

    2. Indeed, the MouseLeftButtonDown event will not be raised because GridView handles it internally.  In order to use it you have to subscribe to it with HandledEventsToo set to true. Please check the following code snippet for a reference:
    public MainWindow()
           {
               InitializeComponent();
     
               this.AddHandler(RadGridView.MouseLeftButtonDownEvent, new MouseButtonEventHandler(clubsGrid_MouseLeftButtonDown), true);
           }
     
           private void clubsGrid_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
           {
     
           }


    Regards,
    Yoan
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  3. PCI
    PCI avatar
    2 posts
    Member since:
    Jul 2014

    Posted 03 Jul 2014 in reply to Yoan Link to this post

    Now I can do multiple selection when I click wherever on the row of grid but I have to click ctrl button earlier. I want to do this without ctrl button. Now when I click on some row that row becomes selected after that but other rows (which were selected before mouse click) aren't already selected.
  4. Yoan
    Admin
    Yoan avatar
    1215 posts

    Posted 04 Jul 2014 Link to this post

    Hello,

    If I understand you correctly the desired behaviour is to have multiple selection without using the Ctrl key. May I ask you to check the attached sample project and let me know how it works for you?


    Regards,
    Yoan
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
Back to Top