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

Enable disable Command / template Column

0 Answers 191 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Venky
Top achievements
Rank 1
Venky asked on 13 Jul 2012, 03:41 AM
I want to enable the ViewDetails command button only if Type is 1 else disable upon grid load, here is the code that displays the data on the grid, but how to Enable/Disable it?

@( Html.Kendo().Grid<KendoUIMVC.Models.SIListing>()
            .Name("Grid")
            .Columns(columns =>
            {
                columns.Bound(p => p.Number).Width(75);
                columns.Bound(p => p.Type).Width(50);
                columns.Command(command => command.Custom("Accept").Click("AcceptDetails")).Width(60);
                columns.Command(command => command.Custom("View").Click("ViewDetails")).Width(60);
            })
            .Pageable()
            .Sortable()
            .Scrollable()
            .Filterable()
            .Groupable()
            .DataSource(dataSource => dataSource
            .Ajax()
                .Read(read => read.Action("getListing", "Listing"))
            )     
)

<script type="text/javascript">
    function ViewDetails(e) {

    }

    function AcceptDetails(e) {
    }

</script>


^^ can some one help?

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Venky
Top achievements
Rank 1
Share this question
or