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

Grid newRow() --> very small row height

2 Answers 213 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Antje
Top achievements
Rank 1
Antje asked on 15 Jan 2014, 05:18 PM
Hello Telerik-Team,

i have a problem with my Grid implementation.

My grid has 0-n rows, and i always want to add one empty row to the grid (so that the user can add a new record). I use this code snippet to add this empty row
var grid = $("#grid").data("kendoGrid");
grid.addRow();
$(".k-grid-edit-row").appendTo("#grid tbody");
 
My problem is, that the new row is very thin. When i click into the emty row, it gets bigger. Is there any possibility to set the row height to that size
as when i click into it?

Thank you

2 Answers, 1 is accepted

Sort by
0
Iliana Nikolova
Telerik team
answered on 17 Jan 2014, 10:28 AM
Hello Antje,

The observed behaviour is expected for empty table cells. In order to avoid this you could define height for the Grid table rows. For example: 
.k-grid tr{
   height: 28px;
}

Regards,
Iliana Nikolova
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Andrew
Top achievements
Rank 1
answered on 24 Jan 2014, 05:06 PM
Like Iliana said this is just what table rows with no content do. You have some options.
Fixing the height of row is one way.
A none breaking whitespace is another hack.
If you can ensure to get rid of the k-grid-edit-row class after the row has been populated, you could alternatively just style k-grid-edit-row separately from the rest, so it has the fixed height without mucking with the rest of your table's row height.
Keep in mind that .k-grid tr{} will effect every row inside of the grid, including all sub grids, non telerik elements, whatever.
Tags
Grid
Asked by
Antje
Top achievements
Rank 1
Answers by
Iliana Nikolova
Telerik team
Andrew
Top achievements
Rank 1
Share this question
or