This is a migrated thread and some comments may be shown as answers.
Change HeaderText for GridTableView inside a GridTableView
2 Answers 20 Views
This is a migrated thread and some comments may be shown as answers.
Antonio
Top achievements
Rank 1
Antonio asked on 03 Mar 2014, 04:29 PM
Hello, i have a GridTableView inside a GridTableView and i want to change the Column Header Text Dynamically (Server Side), the aspx is as follow:

<telerik:RadGrid ID="rgdProducts" runat="Server" AutoGenerateColumns="False" ...>
<MasterTableView Name="MasterTable" AutoGenerateColumns="True" ...>
<DetailTables>
    <telerik:GridTableView Name="NumDetailTable" AutoGenerateColumns="True" ...>
    <DetailTables>
        <telerik:GridTableView Name="UOMDetailTable" AutoGenerateColumns="False" ...>
        <Columns>
             <telerik:GridBoundColumn UniqueName="SortOrder" HeaderText="Sort Order">
        </Columns> 

Hope anyone can help me, Thanks.

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 04 Mar 2014, 03:04 AM
Hi Antonio,

Please try the following code snippet to set the HeaderText of a detail table.

C#:
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
{
  if ((e.Item is GridHeaderItem) && (e.Item.OwnerTableView.Name == "UOMDetailTable"))
  {
    GridHeaderItem headerItem = e.Item as GridHeaderItem;
    LinkButton button = headerItem["SortOrder"].Controls[0] as LinkButton;
    button.Text = "New HeaderText";
  }
}

Thanks,
Princy
0
Manuel Buendia
Top achievements
Rank 1
answered on 23 Aug 2018, 09:40 PM

Gracias @Princy

Tags
Grid
Asked by
Antonio
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Manuel Buendia
Top achievements
Rank 1
Share this question
or