I have followed :
CheckBox Item Template
.cs
the code works well and the style also gets applied to the row containing the checkbox selected. but the only problem is, the checkbox of the row previously selected, remains checked, I need to uncheck it anyway
partially. And it seemed to be working as expected but on thing, I just wanted one row to be selected at a time.
aspx
GridView
<telerik:RadGrid ID=
"gv"
runat=
"server"
AllowSorting=
"true"
AllowFilteringByColumn=
"true"
OnItemCommand=
"ItemCommand"
OnItemDataBound=
"ItemDataBound"
AllowAutomaticUpdates=
"true"
AllowMultiRowSelection=
"false"
OnInsertCommand=
"InsertCommand"
AllowAutomaticInserts=
"true"
OnUpdateCommand=
"ItemUpdated"
ActiveItemStyle-CssClass=
"gv_ActiveItem"
OnNeedDataSource=
"NeedDataSource"
>
CheckBox Item Template
<
telerik:GridTemplateColumn
UniqueName
=
"_SelectCommandColumn"
AllowFiltering
=
"false"
HeaderText
=
"Select"
HeaderAbbr
=
"Check"
>
<
ItemTemplate
>
<
asp:CheckBox
ID
=
"cbSelectCategory"
runat
=
"server"
OnCheckedChanged
=
"cbSelectCategory_CheckedChanged"
AutoPostBack
=
"true"
/>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
.cs
protected
void
cbSelectCategory_CheckedChanged(
object
sender, EventArgs e)
{
((sender
as
CheckBox).NamingContainer
as
GridItem).Selected = (sender
as
CheckBox).Checked;
//getting the id of the selected check-box
}
the code works well and the style also gets applied to the row containing the checkbox selected. but the only problem is, the checkbox of the row previously selected, remains checked, I need to uncheck it anyway