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
close icon

How to Hide a Column in a Grid

How do you hide a column in an ejGrid?
I thought it would be as simple as setting visible to false, however the below is not working for me as the column is still being displayed.

    <e-column field="ID" [isPrimaryKey]="true" editType="numericedit" headerText="ID" width="10" visible="false" textAlign="right"></e-column>

Anyone know why this doesn't work and what I should do instead?

Dave

7 Replies

SA Saravanan Arunachalam Syncfusion Team June 9, 2017 05:21 AM UTC

Hi Dave, 
Thanks for contacting Syncfusion’s support. 
We have analyzed your provided code example and we have modified your to achieve your specified requirement. Please refer to the below code example. 
<e-column field="ID" [isPrimaryKey]="true" editType="numericedit" headerText="ID" width="10" [visible]="false" textAlign="right"></e-column> 
 
Regards, 
Saravanan A. 



DM Dave Monks June 9, 2017 09:05 AM UTC

Thank you, can't believe it was something so simple.


SA Saravanan Arunachalam Syncfusion Team June 12, 2017 04:44 AM UTC

Hi Dave,  
Thanks for your update.       
We are happy that the provided information helped you. 
Regards, 
Saravanan A. 



RP Rama Prabha February 1, 2022 11:36 AM UTC

Hai there,

I have followed the same thing to hide tree grid column by making [visible]=false and it worked. But in column chooser this hidden column appeared.

FYR, in the image provided below, id is a hidden column which is not appeared in tree grid. While triggering choose column 'id' appeared.


Query : How to hide hidden-column name in column chooser?




PS Pon Selva Jeganathan Syncfusion Team February 2, 2022 10:53 AM UTC

Hi Rama, 
 
Thanks for contacting syncfusion forum. 
 
Query : How to hide hidden-column name in column chooser? 
 
Based on your query, we suggest you use the showInColumnChooser property of the treegrid column. Using the showInColumnChooser property, you can hide the particular column in column chooser. 
 
Please refer to the below code snippet, 
 
 <ejs-treegrid 
    [dataSource]="data" 
    allowPaging="true" 
    …. 
  > 
    <e-columns> 
      <e-column 
        field="taskID" 
        headerText="Task ID" 
        width="70" 
        textAlign="Right" 
      ></e-column> 
      <e-column 
        field="taskName" 
        headerText="Task Name" 
        width="200" 
        [visible]="false" 
        [showInColumnChooser]="false" 
      ></e-column> 
 
 
Please refer to the below screenshot, 
 
 
Please refer to the below sample, 
 
Please refer to the below help API documentation, 
 
If does not meet your requirement, kindly Confirm whether you are using Essential Javascript1/ Essential Javascript2. 
 
Kindly get back to us for further assistance. 
 
Regards,   
Pon selva   



RP Rama Prabha February 3, 2022 05:26 AM UTC

Hi,

It perfectly worked. Thank you.

Regards,

Rama Prabha



PS Pon Selva Jeganathan Syncfusion Team February 3, 2022 03:08 PM UTC

Hi Rama 
 
Thanks for the update. 
 
We are glad to hear your query has been solved by our solution. 
 
Kindly get back to us for further assistance. We are happy to assist you. 
 
Regards, 
Pon selva 



Loader.
Live Chat Icon For mobile
Up arrow icon