Adaptive View

15 Dec 20232 minutes to read

The Grid user interface (UI) was redesigned to provide an optimal viewing experience and improve usability on small screens. This interface will render the filter, sort, column chooser, column menu(supports only when the rowRenderingMode as Horizontal) column chooser, column menu(supports only when the rowRenderingMode as Horizontal) and edit dialogs adaptively and have an option to render the grid row elements in the vertical direction.

Render adaptive dialogs

When we enable the enableAdaptiveUI property, the grid will render the filter, sort, and edit dialogs in full screen for a better user experience. This behavior is demonstrated in the below demo.

<div class="e-bigger">
@Html.EJS().Grid("adaptivebrowser").DataSource((IEnumerable<object>)ViewBag.DataSource).EnableAdaptiveUI(true).AllowPaging(true).AllowFiltering(true).AllowSorting(true).Columns(col =>
{
    col.Field("OrderID").HeaderText("Order ID").Width("180").IsPrimaryKey(true).ValidationRules(new { required = true, number = true }).Add();
    col.Field("Freight").HeaderText("Freight").Width("180").Format("C2").EditType("numericedit").ValidationRules(new { required = true }).Add();
    col.Field("CustomerID").HeaderText("Customer ID").Width("180").ValidationRules(new { required = true, minLength = 3 }).Add();
    col.Field("ShipCity").HeaderText("Ship City").Width("180").Add();
}).FilterSettings(filter => { filter.Type(Syncfusion.EJ2.Grids.FilterType.Excel); }).EditSettings(edit => { edit.AllowAdding(true).AllowEditing(true).AllowDeleting(true).Mode(Syncfusion.EJ2.Grids.EditMode.Dialog); }).Toolbar(new List<string>() { "Add", "Edit", "Delete", "Update", "Cancel", "Search" }).Render()
</div>
public IActionResult Index()
{
    var Order = OrderDetails.GetAllRecords();
    ViewBag.DataSource = Order;
    return View();
}

Vertical row rendering

The grid will render the row elements in vertical order while setting the rowRenderingMode property value as Vertical.

<div class="e-bigger">
@Html.EJS().Grid("adaptivebrowser").DataSource((IEnumerable<object>)ViewBag.DataSource).EnableAdaptiveUI(true).RowRenderingMode(Syncfusion.EJ2.Grids.RowRenderingDirection.Vertical).AllowPaging(true).AllowFiltering(true).AllowSorting(true).Columns(col =>
{
    col.Field("OrderID").HeaderText("Order ID").Width("180").IsPrimaryKey(true).ValidationRules(new { required = true, number = true }).Add();
    col.Field("Freight").HeaderText("Freight").Width("180").Format("C2").EditType("numericedit").ValidationRules(new { required = true }).Add();
    col.Field("CustomerID").HeaderText("Customer ID").Width("180").ValidationRules(new { required = true, minLength = 3 }).Add();
    col.Field("ShipCity").HeaderText("Ship City").Width("180").Add();
}).FilterSettings(filter => { filter.Type(Syncfusion.EJ2.Grids.FilterType.Excel); }).EditSettings(edit => { edit.AllowAdding(true).AllowEditing(true).AllowDeleting(true).Mode(Syncfusion.EJ2.Grids.EditMode.Dialog); }).Toolbar(new List<string>() { "Add", "Edit", "Delete", "Update", "Cancel", "Search" }).Aggregates(agg =>
{
    agg.Columns(new List<Syncfusion.EJ2.Grids.GridAggregateColumn>() { new Syncfusion.EJ2.Grids.GridAggregateColumn() { Field = "Freight", Format = "C2", Type = "Sum", FooterTemplate = "Sum: ${Sum}" } }).Add();
}).Render()
</div>
public IActionResult Index()
{
    var Order = OrderDetails.GetAllRecords();
    ViewBag.DataSource = Order;
    return View();
}

NOTE

Supported features by vertical row rendering

The following features are only supported in vertical row rendering:

  • Paging, including Page size dropdown
  • Sorting
  • Filtering
  • Selection
  • Dialog Editing
  • Aggregate
  • Infinite scroll
  • Toolbar - Options like Add, Filter, Sort, Edit, Delete, Search, and Toolbar template are available when their respective features are enabled. The toolbar dynamically includes a three-dotted icon, containing additional features like ColumnChooser, Print, PdfExport, ExcelExport, or CsvExport, once these features are enabled. Please refer to the following snapshot.

VerticalmodeColumnMenu

A snapshot of the adaptive grid displaying enabled paging along with a pager dropdown.

AdaptivePagerDropdown

The Column Menu feature, which includes grouping, sorting, autofit, filter, and column chooser, is exclusively supported for the Grid in Horizontal rowRenderingMode.