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

How to get Header Template Control id in RadGrid_DataBound event?

1 Answer 383 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Guruvu
Top achievements
Rank 1
Guruvu asked on 19 Jan 2011, 12:10 PM
Hi,

In my RadGrid HeaderTemplate one checkBox control is there.My requirement is i need to get this checkBox control id RadGrid_DataBound event.

Note:
I need to get this checkBox control id RadGrid_DataBound event,not in RadGrid_ItemDataBound event.

How can i achieve this requirement.Please help me...

Thanks in advance...

1 Answer, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 19 Jan 2011, 12:43 PM
Hello Guruvu,

Try the following code snippet in DataBound event to access the CheckBox in Headertemplate.

C#:
protected void RadGrid1_DataBound(object sender, EventArgs e)
    {
        GridHeaderItem headerItem = (GridHeaderItem)RadGrid1.MasterTableView.GetItems(GridItemType.Header)[0];
        CheckBox childChkbox = (CheckBox)headerItem.FindControl("CheckBox1");
    }

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