We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

TreeGrid with no header

Is it possible create  server side a treeGrid with no header?

I would like set no header server side because when i do by client side when the document is ready then the treeGrid position doesn't change and this is an undesidered behaviour and doesn't expand in the height in its container. Further if i change the css property manually to have the position and the height desidered then i the treegrid scroll bar doesn't apper correctly.

1 Reply

JD Jayakumar Duraisamy Syncfusion Team July 26, 2017 11:11 AM UTC

Hi Giuseppe, 
Thanks for contacting Syncfusion support. 
We have analyzed your given requirement and we don’t have in-built support to hide TreeGrid header but we can achieve it by workaround to hide TreeGrid header at the client side.  
We have to hide the TreeGrid header colgroup & each th element once after rendered it. For that use create event to add the hidden class css property to hide column header of TreeGrid. 
Please refer following code snippet, 
<style> 
        .e-hide-col{ 
            display:none; 
        } 
    </style> 
<ej:TreeGrid ID="Treegrid" Create="create" 
</ej:TreeGrid>    
function create(args) { 
                 var $colheader = this.getHeaderTable().find('colgroup').find('col'), 
                     $header = this.getHeaderTable().find('tr').find('th'); 
 
                 $($colheader).addClass("e-hide-col"); 
                 $header.addClass("e-hide");                  
             } 
We have also prepared a sample for your reference. Please find the sample location as below, 
Please let us know, if you require any other assistance. 
Regards, 
Jayakumar D 


Loader.
Up arrow icon