Hello,
I have a grid with an ajax data source and ServerOperation set to true. The data source has roughly about 1.5 million entries and I want to display them with virtual scrolling enabled so that only the relevant portion of the data is loaded into the DOM.
Now the problem is that only about half of the available data is shown in the grid when scrolled to the end. See picture "missing_data.png" for clarification.
I tried to troubeshoot the issue myself and came up with this KB article: Virtual Scrolling - Setting the scrollbar, but I cannot get all elements to show with either hint. Apparently a height of 36px is the minimum for a grid row and with that value not all rows are shown. Disabling word-wrap has no effect. I noticed the maximum amount of entries displayed when scrolled to the end changes with different themes and changes sometimes when I scroll to the bottom repeatedly.
Now my question is how can I reliably show all rows and keep virtual scrolling? Currently my grid looks like this:
@(Html.Kendo().Grid<LogEntry>()
.Name(
"grid"
)
.Columns(columns =>
{
columns.Bound(c => c.EventDateTime)
.Title(
"Date"
).Width(100)
.Format(
"{0: dd.MM.yyyy HH:mm:ss}"
);
//.Filterable(config => config
// .UI("DateTimeFilter")
// .Cell(cell => cell
// .Template("DateTimeFilterRow")));
columns.Bound(c => c.EventLevel).Title(
"Level"
).Width(100);
columns.Bound(c => c.MachineName).Title(
"Hostname"
).Width(150);
columns.Bound(c => c.EventMessage).Title(
"Message"
).Width(600)
.HtmlAttributes(
new
{ @
class
=
"nowrap"
});
//columns.Bound(c => c.StackTrace).Hidden();
//columns.Bound(c => c.ErrorMessage).Hidden();
})
.ColumnMenu(config => config
.Sortable(
false
)
.Columns(
true
)
.Enabled(
true
))
.Sortable()
.Groupable()
.Filterable(config => config
.Extra(
false
)
.Mode(GridFilterMode.Row)
.Operators(config => config
.ForDate(config => config
.Clear()
.IsGreaterThanOrEqualTo(
"Ist nach"
)
.IsLessThanOrEqualTo(
"Ist vor"
)
.IsEqualTo(
"Ist gleich"
))
.ForString(config => config
.Clear()
.IsEqualTo(
"Ist gleich"
)
.IsNotEqualTo(
"Ist ungleich"
)
.StartsWith(
"Beginnt mit"
)
.EndsWith(
"Endet mit"
)
.Contains(
"Enthält"
)
.DoesNotContain(
"Enthält nicht"
)
.IsNullOrEmpty(
"ist NULL"
))))
.Scrollable(config => config
.Height(
"auto"
)
//.Endless(true)
.Virtual(
true
))
//.ClientDetailTemplateId("log-detail")
.Resizable(config => config.Columns(
true
))
.Reorderable(config => config.Columns(
true
))
.Pageable(config => config
.Refresh(
true
)
.Numeric(
true
))
//.Events(events => events
// .DetailExpand("onDetailExpand"))
.DataSource(config => config
.Ajax()
.PageSize(200)
.ServerOperation(
true
)
.Read(
"Logs_Read"
,
"Home"
)
.Events(events => events
.Error(
"error_handler"
))
)
)