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

How to display Syncfusion controls in grid columns?

Solution:

You can display the other Syncfusion Essential JavaScript controls using template property of Grid columns.

The following code example shows how to render Syncfusion Essential JavaScript ejRating control as one of the Grid column and set the value based on the column “EmployeeID”.

We have used JSRender conditional tag “if” to set value for Rating control based on condition.

 1. Render the Grid control.

 JS

<script type="text/x-jsrender" id="columnTemplate">

     {{if EmployeeID<3}}

    <input type="text" class="rating" value="3" />

    {{else EmployeeID>2 && EmployeeID<5}}

    <input type="text" class="rating" value="3" />

    {{else EmployeeID>4}}

    <input type="text" class="rating" value="5" />

    {{/if}}
</script>

 

 

JS

 

MVC

 

 

 

 

 

 

 

 

 

ASP.NET

 

 

 

 

2. You can render the ejRating control in Grid column using the templateRefresh event. If ej controls are rendered in templateRefresh event then it will re-render automatically, when any grid action is performed.

JS

               

Note: Similarly, we can bind all other Syncfusion JavaScript controls such as ejDatePicker, ejTimePicker, ejCheckBox etc as one of the column in grid.

 

The following output is displayed as a result of the above code example.

 

Figure: Grid with template column

 

 

Article ID: Published Date: Last Revised Date: Platform: Control:
6798 05/09/2016 05/09/2016 JavaScript ejGrid
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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