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

Grid Template Column

I want to remove the template button based on value in row
I am using template refresh event.
it does not remove the button
what do I need to add to remove the template from the cell?

 col.HeaderText("Delete").Template("<input type=\"button\" value=\"Delete\"  data-toggle=\"tooltip\" title=\"Delete\" onclick=\"WorkOrderDatePartial_WorkOrderDateDelete_click(this)\" />").Width(75).Add();

 function dgWorkOrderDate_TempleteRefresh(args) {

       // var val = args.data["Id"];
        var cell = $(args.cell);

        //render the button control
        // if (val ==null || val==0 || val<1) {
        cell.find(".template").css("visibility", "hidden");


1 Reply

SS Seeni Sakthi Kumar Seeni Raj Syncfusion Team August 11, 2017 05:52 AM UTC

Hi Paul,  
Thanks for contacting Syncfusion Support.  
We can use the jsRender IF/Else cases and prevent the button’s visibility within the template. Refer to the following code example.  
        .Columns(col => 
               . . . 
    <script type="text/x-jsrender" id="columnTemplate"> 
        {{if EmployeeID % 2 == 0}} 
                      <input type="button" value="{{:EmployeeID}}"> 
Seeni Sakthi Kumar S. 

Live Chat Icon For mobile
Up arrow icon