Riddhi Valecha

Riddhi Valecha

  • 441
  • 3.3k
  • 412.8k

Telerik radgrid with checkbox

Dec 28 2015 12:28 PM
Hi all..
 
I need help with telerik radgrid control...
 
My requirement is -
1. Take a radGrid controls and bind it with data - Done
 
2. Add  a  check-box on header and on all rows - Done 
 
3. Script - If the checkbox on header is selected, then all rows should get selected. If again unchecked (unticked), then all rows must not be selected. - Not Getting
 
4. If the user selects only few rows, then get the value of first columns of selected rows - Not Getting.
 
My Design-
 
<telerik:RadGrid ID="rgrdTrips" runat="server" AutoGenerateColumns="true" AllowPaging="false">
<MasterTableView CommandItemDisplay="TopAndBottom" DataKeyNames="Trip_ID">
<Columns>
<telerik:GridTemplateColumn HeaderText="<input type='checkbox' id='checkAll' onclick='checkAllRows(this);'>"
HeaderStyle-Width="50px" UniqueName="Select">
<HeaderTemplate>
<asp:CheckBox ID="checkAll" runat="server" onclick="checkAllRows(this);" />
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="cboxSelect" runat="server" />
</ItemTemplate>
</telerik:GridTemplateColumn>

</Columns>
</MasterTableView>
</telerik:RadGrid> 
 

Answers (2)