I was in a need to enable the user to select a row by clicking on it (not by clicking on some Select link or image or button).
I also wanted this click to postback so I can do some processing on the server side.
It is not so hard to achieve, but I was puzzled for quite a while so I decided to share it.
In order to allow the grid to select a row by clicking on the row, you need to add the ClientSettings to the radGrid and configure the following:
<ClientSettings EnablePostBackOnRowClick="true">
<Selecting AllowRowSelect="true" />
</ClientSettings>
AllowRowSelect is the property to enable / disable row selection.
EnablePostBackOnRowClick will tell the grid to post back on row selection. It is really strightforward when you think of it, but checking so much properties / section to find out if the radGrid has the one you need is annoying sometimes.
Anyway, I am glad that the radGrid has this functionality built-in.
2 comments:
Hi, how could I get the datakey of the selected row and pass it to the server?,
Thank u, you saved my day, documentation is stupid in that aspect.
Post a Comment