This is a migrated thread and some comments may be shown as answers.

Enable disable button in Kendo grid Razor mvc

1 Answer 973 Views
Grid
This is a migrated thread and some comments may be shown as answers.
abc
Top achievements
Rank 1
abc asked on 11 Apr 2014, 09:34 AM
I am currently using by buttons in .Clientrowtemplate like this

@(Html.Kendo().Grid<Modeldata>()
.Name("Grid")

.DataSource(d => d
.Ajax()
.ServerOperation(false)
.PageSize(5)
.Model(model => model.Id(task=> task.Id))
.Read(read => read.Action("getalltask", "task"))
)

.Columns(columns =>
{
columns.Template(e => { }).ClientTemplate(" ").Title("Action").Width("10%");


})
.ClientRowTemplate(
<td class='edit' style='width:10%'>" +
 <input type='button' id='SubTask' title='Add sub Task' class='btnaddsub' onclick = 'AddSubTask( #: data.Id # );' >" 
)

I want to show or hide this button when the #data.Show# is true.  Please guide me in this.

Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 14 Apr 2014, 12:18 PM
Hello,

Kendo UI client templates support Javascript expressions and IF statements, as shown in our documentation:

http://docs.telerik.com/kendo-ui/getting-started/using-kendo-with/aspnet-mvc/helpers/grid/faq#how-do-i-have-conditional-logic-in-a-column-client-template?

http://docs.telerik.com/kendo-ui/getting-started/framework/templates/overview

Regards,
Dimo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
abc
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or