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

CheckboxSelectColumn could not display headertext

2 Answers 70 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Wei Dong
Top achievements
Rank 1
Wei Dong asked on 11 Jan 2013, 04:07 AM
Dear,

      I  have used datagird to loading data , When I set up one cloumn with  checkboxSelectColumn and set up "headertext=select all"" ,But  run this page, this grid didn't display headertext,only  a checkbox in head.

     Please help me to tell me how to solve this problem. thanks a lot.



David

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 11 Jan 2013, 04:42 AM
Hi,

I guess you want to give HeaderText for the GridClientSelectColumn. Please try adding a label to the headeritem for the clientselectcolumn as shown in the code below.

C#:
protected void RadGrid2_ItemCreated(object sender, GridItemEventArgs e)
{
    if (e.Item is GridHeaderItem)
    {
        GridHeaderItem item = (GridHeaderItem)e.Item;
        Label lbl = new Label();
        lbl.ID = "Label1";
        lbl.Text = "Select All";
        item["Select"].Controls.Add(lbl);
    }
}

Thanks,
Shinu.
0
Wei Dong
Top achievements
Rank 1
answered on 11 Jan 2013, 05:48 AM
Thank you very much!
Tags
Grid
Asked by
Wei Dong
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Wei Dong
Top achievements
Rank 1
Share this question
or