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
1075
How to set Child band Header Text,Hide, Resize header, the column from code behind
posted

Hello team, 

In my WHDG, Child bands header get set automatically from datatable which i bind to child band. But I want to changes headers And few column set to hide. Also I want to set auto resize column size.

1) I have 4 leavel of WebHierarchicalDataGrid, And i Want to set Child band Header on ROWExpand event. 

2) I want to set auto resize column size.

3) How to Hide child columns from code behind.

Parents
  • 2735
    posted

    Hello,

    Thank you for contacting Infragistics!
    This is an initial update to let you know that I have received your support request and will be looking into this matter for you. I will follow-up with you regarding my findings.

    Best Regards,

  • 2735
    posted in reply to Stanimir Todorov

    Hello,

    My suggestion for 1):

    You can handle InitializeBand event and customize the header's text :

    http://help.infragistics.com/NetAdvantage/ASPNET/2011.1?page=Infragistics4.Web.v11.1~Infragistics.Web.UI.GridControls.WebHierarchicalDataGrid~InitializeBand_EV.html

    protected void WebHierarchicalDataGrid1_InitializeBand(object sender,BandEventArgs e)

        {

            BoundDataField categoryID;

            // the parent Band

            if (e.Band.Key == "SqlDataSource1_DefaultView")

            {

                categoryID = (BoundDataField)WebHierarchicalDataGrid1.GridView.Columns.FromKey("CategoryID");

                categoryID.Header.Tooltip = " New header CategoryID";

                categoryID.Header.Text = " New header CategoryID";

            }

            else

            {

                categoryID = (BoundDataField)e.Band.Columns.FromKey("CategoryID");

                categoryID.Header.Tooltip = " New header CategoryID";

                categoryID.Header.Text = " New header CategoryID";

            }

    }

    Here as a post that describing 2) point: http://codecorner.galanter.net/2010/11/15/auto-size-columns-in-infragistics-webdatagrid/

    And for 3) point this post show how to hide a column in code behind:

    http://ko.infragistics.com/community/forums/t/59228.aspx

    Best Regards,

Reply Children