Hello,
I have a grid with detail table inside it. I have check box in header column in it which provides "select all" functionality, i.e I want to provide the functionality where clicking on header check box selects all the check box in the column of detail table.
I looked at this Example in the site, but some how I was not able to get the "CheckBox1" control inside item template of the detail table. Please help. Following is the code I have in aspx side.
Thanks
Utkarsh
http://www.utkarshonline.com
I have a grid with detail table inside it. I have check box in header column in it which provides "select all" functionality, i.e I want to provide the functionality where clicking on header check box selects all the check box in the column of detail table.
I looked at this Example in the site, but some how I was not able to get the "CheckBox1" control inside item template of the detail table. Please help. Following is the code I have in aspx side.
<telerik:RadGrid runat="server" AllowMultiRowSelection="false" AutoGenerateColumns="false" ID="radGridChecks" AllowSorting="true" AllowPaging="true" PageSize="7" AllowFilteringByColumn="false" HeaderStyle-HorizontalAlign="Center" GroupingSettings-CaseSensitive="false" AllowAutomaticDeletes="false" AllowAutomaticInserts="false" AllowAutomaticUpdates="false" OnItemDataBound="OnRadGridChecks_ItemDataBound" OnPageIndexChanged="OnRadGridChecks_PageIndexChanged" OnNeedDataSource="OnRadGridCheck_NeedDataSource" OnDetailTableDataBind="OnRadGridCheck_OnDetailTableDataBind" OnItemCommand="OnRadGridCheck_OnItemCommand"> <MasterTableView CommandItemDisplay="Top" EnableColumnsViewState="false" AllowAutomaticDeletes="false" AllowAutomaticInserts="false" AllowAutomaticUpdates="false" Name="ChecksByRepGrid" DataKeyNames="RepCode" ItemStyle-HorizontalAlign="Center"> <CommandItemSettings ShowAddNewRecordButton="false" /> <Columns> <telerik:GridBoundColumn DataField="RepName" HeaderText="Name" /> <telerik:GridBoundColumn DataField="Count" HeaderText="# of Checks" /> </Columns> <DetailTables> <telerik:GridTableView align="right" DataKeyNames="Code" runat="server" Name="ChecksByRepChildGrid" AutoGenerateColumns="false" AllowFilteringByColumn="false"> <ParentTableRelation> <telerik:GridRelationFields DetailKeyField="Code" MasterKeyField="RepCode" /> </ParentTableRelation> <Columns> <telerik:GridBoundColumn DataField="ClientName" HeaderText="Client Name"> <HeaderStyle HorizontalAlign="Center" /> <ItemStyle HorizontalAlign="Center" /> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Status" HeaderText="Status"> <HeaderStyle HorizontalAlign="Center" /> <ItemStyle HorizontalAlign="Center" /> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="CheckNumber" HeaderText="Check #"> <HeaderStyle HorizontalAlign="Center" /> <ItemStyle HorizontalAlign="Center" /> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="PayableTo" HeaderText="Payable To"> <HeaderStyle HorizontalAlign="Center" /> <ItemStyle HorizontalAlign="Center" /> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="ForwardedTo" HeaderText="Forwarded To"> <HeaderStyle HorizontalAlign="Center" /> <ItemStyle HorizontalAlign="Center" /> </telerik:GridBoundColumn> <telerik:GridTemplateColumn UniqueName="CheckBoxTemplateColumn"> <HeaderTemplate> <asp:CheckBox id="headerChkbox" OnCheckedChanged="ToggleSelectedState" AutoPostBack="True" runat="server"></asp:CheckBox> </HeaderTemplate> <ItemTemplate> <asp:CheckBox id="CheckBox1" OnCheckedChanged="ToggleRowSelection" AutoPostBack="True" runat="server"></asp:CheckBox> </ItemTemplate> <HeaderStyle HorizontalAlign="Center" /> <ItemStyle HorizontalAlign="Center" /> </telerik:GridTemplateColumn> </Columns> </telerik:GridTableView> </DetailTables> </MasterTableView></telerik:RadGrid>Thanks
Utkarsh
http://www.utkarshonline.com