Grid (Server Binding) shows empty row

3 posts, 1 answers
  1. BigzampanoXXl
    BigzampanoXXl avatar
    68 posts
    Member since:
    Jan 2007

    Posted 18 Feb 2013 Link to this post

    Hello,
    I have the following problem. When I bind an empty list of items to the grid (Server Binding) the grid shows me an empty row. The empty row has a class name "t-no-data" assigned. I could not find the css class "t-no-data" in any of the Kendo CSS files. Because of the prefix "t-" and not "k-" I assume this is a leftover from the Telerik MVC controls.

    I just tried to override the "t-no-data" class in my custom css file and set the tr height to 0px to hide the empty row, but that does not work...
    .t-no-data
    {
        height: 0px;
    }

    Here is how I defined the Grid in the Razor View:
    @* Server Grid-Binding *@
    @{
        @(Html.Kendo().Grid(Model)
            .Name("GridWFClasses")
            .Columns(columns =>
            {
                columns.Bound(c => c.ID).Width(50).Title(WFClasses.ColumnID).Hidden(true);
                columns.Bound(c => c.Reference).Template(
                    @<text>
                         <a href="javascript:redirectToControllerAction('@item.ControllerUrl')">@item.Reference</a>
                     </text>).Width(150).Title(WFClasses.ColumnReference);
                columns.Bound(c => c.WFTemplateFile.FileName).Width(150).Title(WFClasses.ColumnTemplate);
                columns.Bound(c => c.Description).Width("*").Title(WFClasses.ColumnDescription);
                columns.Bound(c => c.Url).Width(250).Title(WFClasses.ColumnUrl);
                columns.Bound(c => c.EditRights).Width(70).Title(WFClasses.ColumnEditRights);
            })
            .Resizable(m => m.Columns(true))
        )
    }
    And here is a screenshot so you see what I am talking about:

    https://dl.dropbox.com/u/34560718/Kendo_Grid_EmptyLine.png

    Can anyone tell me how I can hide the empy line? Thanks.
  2. Answer
    Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2284 posts

    Posted 18 Feb 2013 Link to this post

    Hi Dietmar,

    To hide the empty row of the grid, you could specify the following CSS styles:
    E.g.

    <style>
      tr.t-no-data{
          display: none;
      }
    </style>
     
      Greetings,
    Dimiter Madjarov
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. BigzampanoXXl
    BigzampanoXXl avatar
    68 posts
    Member since:
    Jan 2007

    Posted 18 Feb 2013 Link to this post

    Thanks a lot. Worked!
Back to Top