Anokrize Anokrize - 1 month ago 12
ASP.NET (C#) Question

Telerik grid mvc empty space

I have a Telerik Kendo UI grid inside a Telerik window. Everything works fine except there is a strange space inside the grid. This might be because of the window in which the grid is located. But I really don't understand this...

Here is my code for the grid and the window:

.Title("Kunden Suche")
.Columns(columns =>
columns.Bound(c => c.KdNr);
columns.Bound(c => c.Vorname);
columns.Bound(c => c.Name);
columns.Bound(c => c.Ort);
columns.Bound(c => c.Strasse);

columns.Command(commands =>
.HtmlAttributes(new { style = "height: 500px" })
.Pageable(pageable => pageable
.DataSource(dataSource => dataSource
.Read(read => read.Action("Kunden_Read", "Api"))
.Actions(actions => actions.Pin().Minimize().Maximize().Close())

I also added an image below.

If I resize the window only for 1px then the grid adopts full size and there is no empty space anymore. But this is during build, if change the size in code for 1px there is no effect on the grid.

enter image description here


Most probably, the Grid is initialized while the Window is not displayed, so it cannot adjust its layout properly.

Use the Window's activate event of the Window to call the resize method of the Grid.