3 Answers, 1 is accepted
Hello Hu,
RadGridView offers SelectionMode property that controls whether and how the cell in the grid can be selected. GridViewSelectionMode can be CellSelect, FullRowSelect or None. More information is available here. Following your requirement, you would like to disable selection only for the end-users but still be able to select programmatically.
You can achieve this behavior by handling the SelectionChanging event which allows you to be canceled. Thus, you can raise a flag of boolean type and manage the selection in the grid as per your requirement. I created a sample project for your reference where selection is disabled when the raised flag is true and enabled when the flag is false ( for example when selecting a row programmatically on a button_Click event )
I hope this helps. Let me know if you have other questions.
Regards,
Nadya
Progress Telerik
Our thoughts here at Progress are with those affected by the outbreak.
Dear Nadya,
Thanks for your reply.
Your answer and sample project were very useful to solve the issue.
In fact, I was using Current rows properties (and not Selected as mentioned in the post). In any case, I use same approach as you described and was able to disable Current row for the end-user.
Regards
Hello Hu,
I am glad that the suggested solution helps to resolve the problem that you had. If you need any further assistance do not hesitate to contact us.
Regards,
Nadya
Progress Telerik
Our thoughts here at Progress are with those affected by the outbreak.