hide data

 Hello,

When a user loads the page with the tree grid if the user has the correct security level I want to show some data if not I need to hide a column in the treegrid for example the Progress column?

How is this possible?







Attachment: Test2_d7047ad5.7z

1 Reply

JR John Rajaram Syncfusion Team August 1, 2018 11:17 AM UTC

Hi David,
Thank you for contacting Syncfusion support.
We have analyzed your requirement. We can achieve your requirement by using “hideColumn” public method in “create” client side event.
 
Please refer the below code snippet

 
 
<ej:TreeGrid runat="server" ID="TreeGridControlDefault" Create="create">
//..
</ej:TreeGrid>
 
<script type="text/javascript">
function create(args) {
  if (args.model.columns.length == 10)
 
     {  
        var treeObj = $("#TreeGridControlDefault").data("ejTreeGrid");  
        treeObj.hideColumn("Progress") //passing the header text to hide the column  
     }  
  }
</script>
 
 
 
We have prepared the sample for your reference please find the sample link below
Link: http://www.syncfusion.com/downloads/support/forum/139011/ze/TreeGridSample1344750239
 
Please let us know if you require further assistance on this.
Regards,
 
John R

 


Loader.
Up arrow icon