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

Prevent deselection of certain rows

1 Answer 69 Views
Grid
This is a migrated thread and some comments may be shown as answers.
JP
Top achievements
Rank 1
JP asked on 24 Sep 2015, 02:29 PM

Hi,

 

I want to disable some selected rows (I use a GridClientSelectColumn) in my grid. The user must not be allowed to deselect these rows, but he is free to select

other rows. The originally selected rows have to stay selected.

Disabling the row is no problem, I do this server-side in the RowBound event handler. But these can still be (de)selected.

Is there some easy way to "lock" the selected rows or do I have to program this behavior in javascript?

If I have to do that, how can I prevent a row from being deselected (e.g. if the user just clicks another row which will deselect all other rows)?

 

Thanks!

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 29 Sep 2015, 10:23 AM
Hello,

Generally, you can use the SelectableMode of the item to disable its selecting/deselecting logic altogether:
http://demos.telerik.com/aspnet-ajax/grid/examples/functionality/selecting/row-selection/defaultcs.aspx

However, it seems that you want to keep the selecting logic. You can try to implement the suggestion provided in the following post to prevent deselecting rows on row click:
http://www.telerik.com/support/code-library/get-selected-items-through-all-pages#kht8vWCthkS9M1nSFAY8yg

Hope this helps. If you have different requirements or further instructions, please elaborate on your specific scenario and send us sample screenshots or videos demonstrating the desired behavior.

Regards,
Eyup
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
JP
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or