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

Grid (Server Binding) shows empty row

2 Answers 472 Views
Grid
This is a migrated thread and some comments may be shown as answers.
BigzampanoXXl
Top achievements
Rank 1
BigzampanoXXl asked on 18 Feb 2013, 09:03 AM
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 Answers, 1 is accepted

Sort by
0
Accepted
Dimiter Madjarov
Telerik team
answered on 18 Feb 2013, 04:06 PM
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!
0
BigzampanoXXl
Top achievements
Rank 1
answered on 18 Feb 2013, 06:01 PM
Thanks a lot. Worked!
Tags
Grid
Asked by
BigzampanoXXl
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
BigzampanoXXl
Top achievements
Rank 1
Share this question
or