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

Dynamically Set Header Text

2 Answers 195 Views
Grid
This is a migrated thread and some comments may be shown as answers.
bill
Top achievements
Rank 1
bill asked on 29 Jun 2010, 07:10 PM


what is the proper way to dynamically set the headetext field? i tried these

 

 

 

<Columns> <telerik:GridBoundColumn DataField="Question" HeaderText='<%#Eval("SubjectArea") %>' SortExpression="Question" UniqueName="ContactName">   
 </telerik:GridBoundColumn>   
 </Columns> 
 
<Columns>   
<telerik:GridBoundColumn DataField="Question" HeaderText='<%#Bind("SubjectArea") %>' SortExpression="Question" 
 
UniqueName="ContactName">   
 </telerik:GridBoundColumn> </Columns>   
 
 

 

 

 

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 30 Jun 2010, 06:23 AM
 Hello Bill,

A better option for changing the HeaderText of GridBoundColumn is by using code behind rather than from mark-up.

C#: 
  
 protected void RadGrid1_PreRender(object sender, EventArgs e) 
    { 
        RadGrid1.MasterTableView.GetColumn("CheckInTime").HeaderText = "Check Out"
        RadGrid1.MasterTableView.Rebind(); 
    } 


Hope this information helps you.
Princy.
0
somsak
Top achievements
Rank 1
answered on 30 Jun 2017, 03:05 AM
ujj
Tags
Grid
Asked by
bill
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
somsak
Top achievements
Rank 1
Share this question
or