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

[Solved] Programmtically accessing the header checkbox in GridClientSelectColumn

2 Answers 152 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Phani Musale
Top achievements
Rank 1
Phani Musale asked on 03 Feb 2010, 10:31 AM
Hi,

I need to programmatically access the checkbox in the column header of a "GridClientSelectColumn" column in the RadGrid control. I tried but with no luck. Can anyone give me the code snippet for the same?

Thanks

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 03 Feb 2010, 10:51 AM
Hello Phani,

You can access the CheckBox control in the headeritem of GridClientSelectedColumn using following code.

CS:
 
    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
    {     
        if (e.Item is GridHeaderItem) 
        { 
            GridHeaderItem headerItem = (GridHeaderItem)e.Item; 
            CheckBox chk = (CheckBox)headerItem["SelectColumn"].Controls[0]; // SelectColumn is ColumnUniqueName
            // chk.Enabled= false; 
        } 
    } 

-Shinu.
0
Phani Musale
Top achievements
Rank 1
answered on 04 Feb 2010, 12:04 PM
Thanks Shinu. It works
Tags
Grid
Asked by
Phani Musale
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Phani Musale
Top achievements
Rank 1
Share this question
or