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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Grid Template Column

Thread ID:





132057 Aug 10,2017 11:23 AM UTC Aug 11,2017 05:52 AM UTC ASP.NET MVC 1
Tags: Grid
Paul Smith
Asked On August 10, 2017 11:23 AM UTC

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");


Seeni Sakthi Kumar Seeni Raj [Syncfusion]
Replied On 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. 


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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

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