Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
105
How to change the Column Header Text from Columns in a GroupField?
posted

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

 

Parents
No Data
Reply
  • 17559
    Verified Answer
    posted

    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.

Children