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

selecting rows in radgridview

3 Answers 175 Views
GridView
This is a migrated thread and some comments may be shown as answers.
PCI
Top achievements
Rank 1
PCI asked on 02 Jul 2014, 11:42 AM
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.

3 Answers, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 02 Jul 2014, 02:47 PM
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.
 
0
PCI
Top achievements
Rank 1
answered on 03 Jul 2014, 05:48 AM
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.
0
Yoan
Telerik team
answered on 04 Jul 2014, 01:24 PM
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.
 
Tags
GridView
Asked by
PCI
Top achievements
Rank 1
Answers by
Yoan
Telerik team
PCI
Top achievements
Rank 1
Share this question
or