I have RadGrid in my Webpage like as below:
My aim is to select all Checkbox on Page Load and When click the SelectAll link in the commandItem template and to deselect all checkbox when click deselectall link in commanditem template. I also want to get the index of the individual checkbox when clicking each checkbox.
To implement this I used the javascript property. RadGrid.get_masterTableView().selectAllItems(true) as referred in the ome of the post in telerik forum.
But the result is a javascript error: object doesnot support this propert or method. I use Telerik 2008 version.
Please reply any solution to select all checkboxes on page load.
Regards,
Tinoy
function GridCreated(sender, args)
{
var grid = sender;
var masterTable = sender.get_masterTableView();
masterTable.selectAllItems(true);
}
<telerik:RadGrid ID ="CandidatesGrid" runat="server" ShowStatusBar="false" AllowPaging="True" AllowSorting="True" PageSize="3" AllowMultiRowSelection="True" GridLines="None" Skin="Outlook" EnableAjaxSkinRendering="true" Width="100%" OnItemCreated="CandidatesGrid_ItemCreated"> <MasterTableView Width="100%" ShowHeader="false" ClientDataKeyNames="ID" GroupLoadMode="Client" AutoGenerateColumns="false" CommandItemDisplay="top"> <CommandItemTemplate> <table> <tr> <td> <label id="lblSelectJobs" runat="server" >Select Jobs</label> </td> <td> <asp:LinkButton ID="lnkSelectAll" runat="server" CommandName="SelectAll" Style="" OnClientClick="SelectRows">Select All</asp:LinkButton> </td> <td> <label id="lblLinkSeparater" runat="server">|</label> </td> <td> <asp:LinkButton ID="lnkDeSelectAll" runat="server" CommandName="DeSelectAll" Style="">DeSelect All</asp:LinkButton> </td> </tr> </table> </CommandItemTemplate> <Columns> <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" AutoPostBackOnFilter="true" ItemStyle-VerticalAlign="Top"/> <telerik:GridBoundColumn Visible="False" DataField="ID" UniqueName="ID" ItemStyle-Width="0" /> <telerik:GridBoundColumn HeaderText="JobDetails" DataField="JobDetails" UniqueName="JobDetails" /> </Columns> </MasterTableView> <ClientSettings EnableRowHoverStyle="true"> <Selecting AllowRowSelect="True" /> <ClientEvents OnRowSelected="GetSelectedNames" OnGridCreated="GridCreated"/> </ClientSettings> </telerik:RadGrid>My aim is to select all Checkbox on Page Load and When click the SelectAll link in the commandItem template and to deselect all checkbox when click deselectall link in commanditem template. I also want to get the index of the individual checkbox when clicking each checkbox.
To implement this I used the javascript property. RadGrid.get_masterTableView().selectAllItems(true) as referred in the ome of the post in telerik forum.
But the result is a javascript error: object doesnot support this propert or method. I use Telerik 2008 version.
Please reply any solution to select all checkboxes on page load.
Regards,
Tinoy