Here is the js code:
function SelectAllCheckedChanged() {
var grid = window['<%= rgManufacturerDisplay.ClientID %>'];
var inputElements = grid.MasterTableView.Control.getElementsByTagName("INPUT");
var headerChecked = window.event.srcElement.checked;
var index;
for (index = 0; index < inputElements.length; index++) {
//NOTE: The GetElementsByTagName("INPUT") will return ALL input controls in the grid, so we have
//to filter to the ones that we specfically care about.
if (inputElements[index].id.indexOf("chkDistributor") != -1) {
//If the id of the control is "chkDistributor" then this is the checkbox in the Select column
//for the grid row and we need to check/uncheck it (only if it's enabled).
if (!inputElements[index].disabled) {
inputElements[index].checked = headerChecked;
}
}
}
}
<telerik:RadGrid ID="rg" runat="server" Skin="Office2010Silver" OnNeedDataSource="rg_NeedDataSource"OnItemCommand="rgScores_ItemCommand"><ExportSettings HideStructureColumns="true" /><MasterTableView AllowPaging="true" AllowSorting="true" Width="100%" CommandItemDisplay="Top"><CommandItemSettings ShowExportToExcelButton="true" ShowRefreshButton="false" ShowAddNewRecordButton="false" /></MasterTableView></telerik:RadGrid><script type="text/javascript"> function RequestStart(sender, args) { if (args.EventTarget == "Button1") { args.EnableAjax = false; } } </script> <%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head id="Head1" runat="server"> <title></title> <asp:ContentPlaceHolder id="head" runat="server"> </asp:ContentPlaceHolder> <link id="FavLink1" runat="server" rel="shortcut icon" href="~/Images/favicon.ico" type="image/x-icon" /> <link id="FavLink2" runat="server" rel="icon" href="~/Images/favicon.ico" type="image/ico" /></head><body> <form id="form1" runat="server"> <telerik:RadScriptManager ID="RadScriptManager1" Runat="server"> <Scripts> <asp:ScriptReference Path="Scripts/jquery-1.8.2.min.js" /> </Scripts> </telerik:RadScriptManager> <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" Runat="server"> </telerik:RadStyleSheetManager> <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" ShowStartingNode="False" /> <div style="text-align: left; width: 99.9%;"> <table style="width: 100%;"> <tr> <td colspan="3" style="HEIGHT: 5px; BACKGROUND-COLOR: navy"> </td> </tr> <tr> <td style="width:150px;"> <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/Images/Logo.bmp" PostBackUrl="~/Default.aspx" ToolTip="Home" /> </td> <td style="text-align:left;width: 60%; padding-left: 10px;"> <h1>Help Desk</h1> </td> <td style="text-align:right; width:25%; vertical-align: bottom; font-size: x-small; padding-right: 2px;"> Logged in as: <asp:Label ID="lblUser" runat="server" EnableTheming="False" Font-Size="X-Small"></asp:Label> </td> </tr> <tr> <td colspan="3"> <telerik:RadMenu ID="RadMenu1" Runat="server" DataSourceID="SiteMapDataSource1" Skin="Default" Width="100%" style="z-index: 1000"> <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> </telerik:RadMenu> </td> </tr> </table> </div> <div style="width: 99.9%;"> <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"> </asp:ContentPlaceHolder> </div> </form></body></html>