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

did't show grid but show calendar

1 Answer 92 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Krasimir
Top achievements
Rank 1
Krasimir asked on 11 Mar 2013, 05:50 PM
This is my code for simple kendoGrid but it's didn't show the grid only html table . My scripts are in Layout.cshtml. And kendo works fine with HTMLhelpers.What am i missing
<script>
    
    $("#ProfitTab").kendoGrid()
</script>
<table id="ProfitTab">
    <thead>
    <tr>
           <th>
            @Html.DisplayNameFor(model => model.IdCategory)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Value)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Description)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.DateInput)
        </th>
        <th>Action</th>
    </tr>
    </thead>
    <tbody>
@foreach (var item in Model) {
    <tr>
         <td>
            @Html.DisplayFor(modelItem => item.IdCategory.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Value)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Description)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.DateInput)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.Id }) |
            @Html.ActionLink("Details", "Details", new { id=item.Id }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.Id })
        </td>
    </tr>
}
    </tbody>
</table>

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 13 Mar 2013, 09:18 AM
Hello Krasimir,

It seems like you are trying to create a Grid widget from an element which has not yet been rendered at the time the Javascript statement is executed. Please move the script after the HTML markup or use a document.ready jQuery handler.

Regards,
Dimo
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
Krasimir
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or