ButterBeast
ButterBeast

Reputation: 551

Dynamically changing column name

I am using rad:radgrid datagrid control. I need to change column header text dynamically.

I try rgGrid.Columns[0].HeaderText = "Id" and it works fine for GridBoundColumn, but now I need to do the same for GridButtonColumn but it not working

I also try:

<rad:GridButtonColumn HeaderText="<%= stringText %>" > 

but it doesn't work becouse rad controls does not allowed to use <% %>.

Thanks!

Upvotes: 1

Views: 1596

Answers (1)

Eduardo Molteni
Eduardo Molteni

Reputation: 39443

I'm guessing here, but since all WebControls allow setting an ID and then call the control by the ID, you can:

<rad:GridButtonColumn ID="MyGridButtonColumn"> 

and then in the CodeBehind:

MyGridButtonColumn.MyHeaderText = stringText;

Upvotes: 1

Related Questions