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

Header Template Only

2 Answers 49 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Oded
Top achievements
Rank 1
Oded asked on 13 May 2009, 09:17 AM
Hello,

I have a grid on my page that with the AllowMultiRowEdit set to true. I create the columns through code. I would like to have one of the columns to have a template header. I don't need a template for any other item type.

Is there a way to have a template only for the header of the column?

Thanks,

Oded

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 13 May 2009, 09:48 AM
Hello Oded,

I guess you want to add control to the Header of RadGrid. If so you can try the following code snippet. The example shows how to add TextBox in column header.

CS:
 
protected void RadGrid1_PreRender(object sender, EventArgs e) 
    GridHeaderItem headerItem = RadGrid1.MasterTableView.GetItems(GridItemType.Header)[0] as GridHeaderItem; 
    TextBox txtBox = new TextBox(); 
    txtBox.Text = "My TextBox"
    headerItem["ColumnUniqueName"].Controls.Add(txtBox);  

Thanks,
Shinu.
0
Oded
Top achievements
Rank 1
answered on 14 May 2009, 10:46 AM
Thanks Shinu,

That is what I needed.

Oded

Tags
Grid
Asked by
Oded
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Oded
Top achievements
Rank 1
Share this question
or