0
votes

I have a RadGrid with AllowMultiRowSelection="true", EnablePostBackOnRowClick="false", and UseClientSelectColumnOnly="false". The documented behavior is:

When multi-row selection is enabled, clicking on a row still de-selects any other selected rows. Users can select multiple rows by holding the Ctrl key down while clicking on a row.

However, the behavior for the "Client Select Column" (i.e. a checkbox column) is to toggle the row when the checkbox is clicked.

I want to apply the checkbox behavior (toggling) to any click on the row. I know this isn't the intended behavior of the grid, but it ought to be possible through some client-side scripting (i.e. click the row and it toggles the appropriate checkbox). Can anyone help me figure out such a script?

1
Hi not sure if I understand you correctly there. You have a multirowselect allowed grid. Then when you click on a row there you want to select the row as if the ctrl key has been pressed down? OR do you just want to toggle a checkbox inside the clicked on row? - Thomas
@ThomasE. - Either one. Both of those will accomplish the same thing (toggling the row). It makes more sense to me to toggle the checkbox, but if it's easier to treat it like ctrl was pressed, I'm good with that. - Bobson
Radgrid is the ASP.NET correct? Would only know how to do something like that for winforms if that helps (not sure how different the ASP telerik control handles things from the winforms control so if it could be useful I'll post what I'm doing in winforms there for a similar problem). - Thomas
@ThomasE. - Yeah, it's a custom ASP.NET control. Powerful, but sometimes annoying. Nothing at all like the Winforms version of a grid, unfortunately. Thanks, though. - Bobson
I meant the telerik winforms gridview control there. Take a look though maybe it can be done similarily. There I hang into the on_click handler of the grid itself and just put something like: MyGrid.CurrentRow.Cells["mycheck"].Value = 1; there. If you have a currentrow property also in the asp version of the telerik control you could use that one to achieve the same result. - Thomas

1 Answers

0
votes

To avoid deselection of any other selected rows by click on the specific row you can just set UseClientSelectColumnOnly="True". As result you can toggle checkbox only by click on the checkbox.

It doesn't help you with click on the row, but it helps to avoid unexpected deselection.