commanditemtemplate
<td align="right" style="width: 20%">
Selected Records:<asp:Label ID="lblselTsks" Width="20px" Font-Size="10pt" Font-Bold="true"
runat="server" Text="0"></asp:Label>
</td>
Grid client select column....
<telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" HeaderStyle-Width="3%"
ItemStyle-Width="3%">
<HeaderStyle Width="3%"></HeaderStyle>
<ItemStyle Width="3%"></ItemStyle>
</telerik:GridClientSelectColumn>
codebehind and JS
protected void rg200_DataBound(object sender, EventArgs e)
{
foreach (GridDataItem item in rg200.MasterTableView.Items)
{
CheckBox chkBoxOne = (CheckBox)item.FindControl("ClientSelectColumn");
if (chkBoxOne != null)
chkBoxOne.Attributes.Add("onclick", "javascript:return SelectOne('" + chkBoxOne.ClientID + "')");
}
}
function SelectOne(id) {
var count = 0;
count = Number(document.getElementById('ctl00_PagePlaceholder_rg200_ctl00_ctl02_ctl00_lblselTsks').innerHTML);
if (document.getElementById(id).checked == true) {
if (!document.getElementById(id).disabled) {
count = count + 1;
}
}
else if (document.getElementById(id).checked == false) {
if (!document.getElementById(id).disabled) {
count = count - 1;
}
}
document.getElementById('ctl00_PagePlaceholder_rg200_ctl00_ctl02_ctl00_lblselTsks').innerHTML = count;
} |