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

Grid Column visibility is not working

Hi,

I try to use the visibility for grid column, but as for the sample given in https://ej2.syncfusion.com/vue/documentation/grid/columns/#visibility, the ShipCity column is defined as visible false, however, from the preview, the column is still visible, so it is not working properly?

Thanks,
Jzy

5 Replies

PS Pavithra Subramaniyam Syncfusion Team February 13, 2019 05:18 AM UTC

Hi Jzy, 
 
Sorry for the inconvenience caused. 
 
You can set the visible property for Grid column as following in Vue. Please refer to the below code example and sample link. 
 
[vue] 
new Vue({ 
              el: '#app', 
              template: ` 
    <div id="app"> 
     <ejs-grid :dataSource="data" :allowPaging='true'> 
           <e-columns> 
            <e-column field='OrderID' headerText='Order ID' textAlign='Right' width=90></e-column> 
            <e-column field='CustomerID' headerText='Customer ID' width=120></e-column> 
            <e-column field='Freight' headerText='Freight' textAlign='Right' width=90></e-column> 
            <e-column field='ShipCity' :visible=false headerText='Ship City' width=120></e-column> 
          </e-columns> 
        </ejs-grid> 
        </ejs-grid> 
     </div> 
`, 
 
 
However, we will correct the documentation for visibility and it will be refreshed in any of our upcoming release. 
 
Regards,  
Pavithra S. 
 



JZ Jzy February 13, 2019 07:05 AM UTC

Hi Pavithra,

Thank you so much for clarifying it. So one colon is missing in the example (:visible instead of visible) : )

Thanks,
Jzy


PS Pavithra Subramaniyam Syncfusion Team February 13, 2019 07:16 AM UTC

Hi Jzy,  

Yes. You need to use the provided code(:visible) to achieve your requirement.  We will change it in our documentation as well. 

Please contact us if you need any further assistance. As always, we will be happy to assist you.  

Regards,  
Pavithra S. 



AK Arun Kumar July 22, 2020 09:41 AM UTC

Hi Team,

Is it possible to hide column based on database value? If yes can you share some sample codes. 

I am trying to hide/show column based on some boolean value from database.

Thank,
Arun


BS Balaji Sekar Syncfusion Team July 23, 2020 12:27 PM UTC

Hi Arun, 
 
No, We can define the Grid column property(ex: visible) either with a one value(either true or false) to render, but each record has a different value defined to fields in database so we cannot apply that value to the Grid column property. 
 
If we misunderstood your concern, please share your exact requirement to us that will help to validate further. 
 
Regards, 
Balaji Sekar 


Loader.
Live Chat Icon For mobile
Up arrow icon