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

Kendo UI Grid different detail templates depending on condition

0 Answers 153 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jevgenij
Top achievements
Rank 1
Jevgenij asked on 19 Nov 2012, 12:05 PM
have such grid defined

@(Html.Kendo().Grid<FieldViewModel>(Model.Fields)
    .HtmlAttributes(new { @class = "fullScreen" })
    .Name("formFields")
    .ClientDetailTemplateId("formFieldsTemplate")
    .Columns(columns =>
        {
            columns.Bound(e => e.Key);
            columns.Bound(e => e.DisplayName);
            columns.Bound(e => e.FieldTypeName);
            columns.Bound(e => e.Order);
            columns.Bound(e => e.IsMandatory);
            columns.Bound(e => e.Type);
        })
    .Pageable()
    .Sortable()
    .Scrollable()
    .Selectable()
    .Resizable(resize => resize.Columns(true))
    .Groupable()
    .Filterable()
      .DataSource(dataSource => dataSource.Ajax().ServerOperation(false).Model(model => model.Id(e => e.Key))))
and details template

<script id="formFieldsTemplate" type="text/kendo-tmpl">
    @(Html.Kendo().Grid<FieldViewModel>()
        .Name("FormField_#=Key#")
        .ClientDetailTemplateId("formFieldsTemplate")
        .Columns(columns =>
            {
                columns.Bound(e => e.Key);
                columns.Bound(e => e.DisplayName);
                columns.Bound(e => e.FieldTypeName);
                columns.Bound(e => e.Order);
                columns.Bound(e => e.IsMandatory);
                columns.Bound(e => e.Type);
            })
        .DataSource(dataSource => dataSource.Ajax().Read(read => read.Action("LoadFieldDetails", "Forms", new { formPath = Model.Schema, rootElementName = Model.Root ,fieldKey = "#=Key#" })))
        .Pageable()
        .Sortable()
        .Selectable()
        .ToClientTemplate())
</script>

As you can see I have Type property, so what I want to do is not to show any details view and no arrow on the entire row when Type property is set to the specific value. How can I achieve it?

No answers yet. Maybe you can help?

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