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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Hide Grid Header Row when the column uses a jsrender Template is not working

Thread ID:

Created:

Updated:

Platform:

Replies:

131273 Jul 3,2017 02:02 AM UTC Jul 13,2017 10:46 AM UTC ASP.NET Core 5
loading
Tags: Grid
dsapo
Asked On July 3, 2017 02:02 AM UTC

Hi Support:

I have a grid with only one column defined a template as:

<e-columns>
       <e-column template="#detailTemplate"></e-column>
</e-columns>

But the following code is ignored:

function onDatabound(args) {
          
            //hide Grid header
            this.getHeaderContent().addClass("e-hide");
}

There is no error, but the header does not get hidden.

Thanks in advanced

David



Farveen Sulthana Thameeztheen Basha [Syncfusion]
Replied On July 3, 2017 05:27 PM UTC

Hi customer, 

Thanks for contacting syncfusion support. 

You can hide the Header of the template column by using “data-bound” event of the Grid. In the below code example we have bound the “data-bound” event for the grid and from that we have remove the header element of grid using “getHeaderTable” method in grid.  
 
Please refer to the code example:- 
 
<ej-grid id="FlatGrid" allow-paging="true" data-bound="bound" datasource="ViewBag.DataSource"> 
     <e-columns> 
          <e-column field="OrderID" template="#detailTemplate" is-primary-key="true"></e-column> 
          <e-column field="EmployeeID"></e-column> 
          <e-column field="CustomerID"></e-column> 
          <e-column field="Freight"></e-column> 
      </e-columns> 
 </ej-grid> 
     <script> 
            function bound(args) { 
                this.getHeaderTable().remove(); 
 
            } 
     </script> 
 
 
Please get back to us if you need any further assistance. 

Regards, 

Farveen sulthana

dsapo
Replied On July 5, 2017 08:38 PM UTC

Hi Farveen :

I tried your suggestion but it did not work.


To remove the header row I added the following css, but is not an elegant solution, so I prefer to make it to work with your approach:

 .e-headercell, .e-headercelldiv, .e-gridheader

    {

        height:0 !important;

        border:0 !important;

    }


My Grid definition is:

 <ej-grid id="grid1"

                                 action-begin="begin"

                                 allow-resize-to-fit="true"

                                 allow-paging="true"

                                 is-responsive="true"

                                 enable-row-hover="false"

                                 allow-selection="false"

                                 action-complete="onComplete" 

                                 data-bound="onDatabound"

                                 >

                           <e-datamanager url="/DataSource" adaptor="UrlAdaptor" />

                            <e-columns>

                                <e-column template="#detailTemplate"></e-column>

                            </e-columns>

                            <e-page-settings page-size="10"></e-page-settings>

                        </ej-grid>


What could be my issue.

Regards,

David




Farveen Sulthana Thameeztheen Basha [Syncfusion]
Replied On July 6, 2017 03:52 PM UTC

Hi David, 

We are unable to reproduce your reported problem “Grid Header doesn’t get hide’ at your end. Could you please share us the following details to find the cause of the issue. 

1. Grid code example( share the code example of data-bound event ). 

2. Have you used any customized CSS for Grid. If so please share the code. 

3. Screenshot or Video if any script error occurs.  

The provided information will help us to analyze and provide you the solution as early as possible. 
 
Regards, 
 
Farveen sulthana T 



dsapo
Replied On July 12, 2017 03:59 PM UTC

Thanks Farveen.

Now is working as expected.



Farveen Sulthana Thameeztheen Basha [Syncfusion]
Replied On July 13, 2017 10:46 AM UTC

Hi David, 
  
Thanks for your update that your reported problem was resolved. 
  
Please get back to us if you need any further assistance. 
  
Regards, 
  
Farveen sulthana T 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;