GridScrollSettingsBuilder
Methods
Enabled(System.Boolean)
Enables or disables scrolling.
Parameters
value - System.Boolean
The boolean value for the scrolling functionality. If set to true the grid will display a scrollbar when the total row height (or width) exceeds the grid height (or width). By default scrolling is enabled.
Example
@(Html.Kendo().Grid<OrderViewModel>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.OrderID).Filterable(false);
columns.Bound(p => p.Freight);
})
.Scrollable(s => s.Enabled(true))
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Read(read => read.Action("Orders_Read", "Grid"))
)
)
Height(System.Int32)
Sets the height of the scrollable area in pixels.
Parameters
pixelHeight - System.Int32
The height in pixels.
Example
@(Html.Kendo().Grid<OrderViewModel>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.OrderID).Filterable(false);
columns.Bound(p => p.Freight);
})
.Scrollable(s => s.Height(400))
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Read(read => read.Action("Orders_Read", "Grid"))
)
)
Height(System.String)
Sets the height of the scrollable.
Parameters
value - System.String
The height in units.
Example
@(Html.Kendo().Grid<OrderViewModel>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.OrderID).Filterable(false);
columns.Bound(p => p.Freight);
})
.Scrollable(s => s.Height("20pt"))
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Read(read => read.Action("Orders_Read", "Grid"))
)
)
Virtual(System.Boolean)
Enables or disabled virtual scrolling.
Parameters
value - System.Boolean
Configures the grid virtualization settings. If set to true the grid will enable row virtualization and display a single page of data.
Example
@(Html.Kendo().Grid<OrderViewModel>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.OrderID).Filterable(false);
columns.Bound(p => p.Freight);
})
.Scrollable(s => s.Virtual(true))
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Read(read => read.Action("Orders_Read", "Grid"))
)
)
Virtual(Kendo.Mvc.UI.GridVirtualizationMode)
Configures the grid virtualization mode.
Parameters
value - GridVirtualizationMode
The grid virtualization mode
Example
@(Html.Kendo().Grid<OrderViewModel>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.OrderID).Filterable(false);
columns.Bound(p => p.Freight);
})
.Scrollable(s => s.Virtual(GridVirtualizationMode.Rows))
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Read(read => read.Action("Orders_Read", "Grid"))
)
)
Endless(System.Boolean)
Enables or disables endless scrolling.
Parameters
value - System.Boolean
If set to true the grid will always display a single page of data. Scrolling to the end will load more items untill all items are displayed.
Example
@(Html.Kendo().Grid<OrderViewModel>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(p => p.OrderID).Filterable(false);
columns.Bound(p => p.Freight);
})
.Scrollable(s => s.Endless(true))
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Read(read => read.Action("Orders_Read", "Grid"))
)
)