This is a migrated thread and some comments may be shown as answers.

Grid check box disabled

1 Answer 87 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kevin Cauchi
Top achievements
Rank 1
Kevin Cauchi asked on 27 Jun 2011, 09:19 AM
Hi there.

I have a grid where I am binding a data table. The first column is a check box. The problem is that it is read only on the grid.

What I want is a column with a check box that can be checked and unchecked. Also i want the same with its header. When the header check box is ticked, all the other check boxes should be ticked as well.

This is what i have right now

<telerik:RadGrid ID="RadGrid1" runat="server" GridLines="None" AutoGenerateColumns="true">
   <MasterTableView>
        <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
 
        <RowIndicatorColumn>
            <HeaderStyle Width="20px"></HeaderStyle>
        </RowIndicatorColumn>
 
        <ExpandCollapseColumn>
            <HeaderStyle Width="20px"></HeaderStyle>
        </ExpandCollapseColumn>
        <Columns>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

System.Data.DataTable dt = new System.Data.DataTable();
 
System.Data.DataColumn column0 = new System.Data.DataColumn("IsEnabled", typeof(bool));
System.Data.DataColumn column1 = new System.Data.DataColumn("Rule", typeof(string));
System.Data.DataColumn column2 = new System.Data.DataColumn("Status", typeof(string));
System.Data.DataColumn column3 = new System.Data.DataColumn("Priority", typeof(string));
System.Data.DataColumn column4 = new System.Data.DataColumn("UpImg", typeof(string));
System.Data.DataColumn column5 = new System.Data.DataColumn("DownImg", typeof(string));
 
dt.Columns.Add(column0);
dt.Columns.Add(column1);
dt.Columns.Add(column2);
dt.Columns.Add(column3);
dt.Columns.Add(column4);
dt.Columns.Add(column5);
 
System.Data.DataRow row = dt.NewRow();
 
row[column0] = true;
row[column1] = "test";
row[column2] = "test";
row[column3] = "0";
row[column4] = "test";
row[column5] = "test";
 
dt.Rows.Add(row);
 
RadGrid1.DataSource = dt;
RadGrid1.DataBind();

Thanks in advance

1 Answer, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 27 Jun 2011, 09:47 AM
Hello Kevin,

Try the same approach in the following demo.
Selecting a row with a checkbox (server-side).

Hope it helps.

Thanks,
Princy.
Tags
Grid
Asked by
Kevin Cauchi
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or