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
70
Styling ExpansionColumnHeader in childgrid
posted

I would like to have a different header style on "child" grids in the webhierarchicaldatagrid.

I have managed to change the style of all the regular columns, but have problems with the expansion column header.

How may I set the ExpansionColumnHeader CssClass of a containerGrid?

 

Parents
No Data
Reply
  • 70
    Verified Answer
    posted

    I've got the Expansion Column Header changing styles for the child rows using the WHDG's RowExpanded client event.  I then get the column header through some javascript and add my new style to the element.

    I've pasted my RowExpanded event below to demonstrate how I accomplished this.

    function WebHierarchicalDataGrid1_ContainerGrid_RowExpanded(sender, eventArgs)
    {
        ///<summary>
        ///
        ///</summary>
        ///<param name="sender" type="Infragistics.Web.UI.ContainerGrid"></param>
        ///<param name="eventArgs" type="Infragistics.Web.UI.ContainerGridRowEventArgs"></param>

        //  Get the island we've expanded.
        var island = eventArgs.get_row().get_rowIslands()[0];

        //  Access the expansion column header through the first column's sibling.
        var expansionColumnHeaderElem = island.get_columns().get_column(0).get_headerElement().previousSibling;
        expansionColumnHeaderElem.className = expansionColumnHeaderElem.className + " NewStyle";
        //$(expansionColumnHeaderElem).addClass("NewStyle");
    }

Children
No Data