Before I chanced my columns into two separate GroupFields I could change the Column Header Text, but now the option to change the Header Text at runtime is gone.
Before Working Code
((Infragistics.Web.UI.GridControls.WebDataGrid)FormViewLead.FindControl("WebDataGrid")).Columns["column1"].Header.Text = "Column 1";
But now that they are Groupped
((Infragistics.Web.UI.GridControls.WebDataGrid)FormViewLead.FindControl("WebDataGrid")).FindControl("GroupField_1").???
Any guidence is appreciated.Thank you
Hello Gridster ,
In order to change the text of the group column you can try the following code snippet:
(WebDataGrid1.FindColumn("group1") as GroupField).Header.Text = "some other text";
where your columns are defined as follows:
<Columns> <ig:GroupField Key="group1" Header-Text="Group1"> <Columns> <ig:BoundDataField DataFieldName="ProductID" Key="ProductID"> <Header Text="ProductID" /> </ig:BoundDataField> <ig:BoundDataField DataFieldName="ProductName" Key="ProductName"> <Header Text="ProductName" /> </ig:BoundDataField> </Columns> </ig:GroupField> <ig:BoundDataField DataFieldName="SupplierID" Key="SupplierID"> <Header Text="SupplierID" /> </ig:BoundDataField> <ig:BoundDataField DataFieldName="CategoryID" Key="CategoryID"> <Header Text="CategoryID" /> </ig:BoundDataField> </Columns>
If you need any additional assistance on the matter please let me know.
Elena,
That worked great.
(((WebDataGrid)FormView1.FindControl("WebDataGrid1")).FindColumn("GroupField1") as GroupField).Columns["FirstGroupColumn1"].Header.Text = "Yea...it works";
Thank you.