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

use GridViewSelectColumn as only method of selection?

2 Answers 142 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Sandy
Top achievements
Rank 1
Sandy asked on 20 Dec 2010, 08:02 PM
Hi -
I want to use the GridViewSelectColumn as the ONLY method of row selection. Desired behavior: if a user clicks on a row, nothing will happen. But if they click on the checkbox in the GridViewSelectColumn, the row will be selected. In addition, the header checkbox in the GridViewSelectColumn must continue to select/de-select all rows. How can I best achive this?

I have tried setting the CanUserSelect=false on a grid containing a GridViewSelectColumn. This works fine for individual rows (only allowing row selection via the GridViewSelectColumn), however, if I click the GridViewSelectColumn Header checkbox, nothing happens (no rows are selected/de-selected).

I have also gone about handling the DataGridCell_PreviewMouseLeftButtonDown and DataGrid_PreviewMouseLeftButtonDown events, which allows the GridViewSelectColumn Header checkbox to work correctly, but it's definitely a hack, and not something I can easily implement across the many RadGridViews in my application.

Any help is appreciated.

2 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 21 Dec 2010, 09:46 AM
Hi Sandy Lamoureux,

Setting the CanUserSelect property of the grid to "False" is the right way to go. We did have a similar issue like the one you described but it has already been fixed. I am sending you the sample project I used for testing you scenario with our latest official release Q3 2010, where everything works as expected. 
Please take a look at it and let me know in case you need any further assistance.

Best wishes,
Maya
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
Sandy
Top achievements
Rank 1
answered on 21 Dec 2010, 06:18 PM
Thank you for the sample...I guess we'll have to look at moving to the newest version of the controls.
Thanks for your quick response!

--Sandy
Tags
GridView
Asked by
Sandy
Top achievements
Rank 1
Answers by
Maya
Telerik team
Sandy
Top achievements
Rank 1
Share this question
or