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

Detail Template not showing data

3 Answers 196 Views
Grid
This is a migrated thread and some comments may be shown as answers.
H2e
Top achievements
Rank 1
H2e asked on 29 Jan 2013, 01:59 PM
Hi, sorry if this has already been answered but I'm fairly new to this.  Anyway  I've implemented the Kendo Grid in my VB.NET MVC 3 project.  I thought it would be good to have a drilldown details template, but the details template won't populate with data...i've tried everything..can anyone help?  It's in VB.NET so there may be something lost in translation somewhere.

Any help would be greatly appreciated

@(Html.Kendo().Grid(Of Models.Device) _
    .Name("Devices") _
    .Groupable() _
    .Filterable() _
    .HtmlAttributes(New With {.style = "width: 100%", .align = "center"}) _
    .Columns(Function(columns)
                     columns.Bound(Function(p) p.Tag).Groupable(True).Width(200)
                     columns.Bound(Function(p) p.Enabled).Groupable(True).Width(200)
                     columns.Bound(Function(p) p.Description).Groupable(True).Width(200)
                     columns.Bound(Function(p) p.Suffix).Groupable(True).Width(200)
                     columns.Command(Function(command)
                                             command.Edit()
                                             command.Destroy()
                                     End Function).Width(200)
             End Function) _
    .Editable(Function(editable) editable.Mode(GridEditMode.InLine)) _
    .ToolBar(Function(toolbar) toolbar.Create()) _
    .DataSource(Function(dataSource)
                        dataSource.Ajax.Events(Function(events) events.Error("error_handler"))
                        dataSource.Ajax.Model(Sub(model) model.Id(Function(p) p.Suffix))
                        dataSource.Ajax.Create(Function(create) create.Action("Device_Create", "Device"))
                        dataSource.Ajax.Read(Function(read) read.Action("Device_Read", "Device"))
                        dataSource.Ajax.Update(Function(update) update.Action("Device_Update", "Device"))
                        dataSource.Ajax.Destroy(Function(delete) delete.Action("Device_Delete", "Device"))
                End Function) _
    .Events(Function(events)
                    events.DataBound("dataBound")
            End Function) _
        .ClientDetailTemplateId("RuleTemplate")
    )
 
  <script>
        function dataBound() {
            this.expandRow(this.tbody.find("tr.k-master-row").first());
        }
</script>
 
<script id="RuleTemplate" type="text/kendo-tmpl">
 
                                                                        @(Html.Kendo().Grid(Of Models.DeviceRule) _
                                                                        .Name("Rules_#=Suffix#") _
                                                                        .Columns(Function(columns)
                                                                                         columns.Bound(Function(p) p.Suffix).Groupable(True)
                                                                                         columns.Bound(Function(p) p.RuleID).Groupable(True)
                                                                                         columns.Bound(Function(p) p.Name).Groupable(True)
                                                                                         columns.Bound(Function(p) p.Priority).Groupable(True)
                                                                                         columns.Bound(Function(p) p.Active).Groupable(True)
                                                                                 End Function) _
                                                                        .DataSource(Function(dataSource)
                                                                                            dataSource.Ajax.Read(Function(read) read.Action("DeviceRules_Read", "Device", New With {.Suffix = "#=Suffix#"}))
                                                                                    End Function) _
                                                                        .Pageable() _
                                                                        .Sortable() _
                                                                        .ToClientTemplate())
                                                                 
</script>

3 Answers, 1 is accepted

Sort by
0
H2e
Top achievements
Rank 1
answered on 29 Jan 2013, 02:10 PM
Never mind.  Managed to sort it.  Hadn't set up the datasource for the template properly so it wasn't handling the parameter
0
H2e
Top achievements
Rank 1
answered on 29 Jan 2013, 02:37 PM
Hmm ok that still didn't fix it.  Any ideas?
0
Daniel
Telerik team
answered on 31 Jan 2013, 02:13 PM
Hello Tony,

The code looks correct. Are there any JavaScript errors thrown when the row is expanded? If no, could you check the network traffic and see if a request is made at all? Also, what are the values in the data for the "Suffix" property?

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