Skip to content

Latest commit

 

History

History
37 lines (25 loc) · 1.42 KB

Grid_dimensions.md

File metadata and controls

37 lines (25 loc) · 1.42 KB

Blazor WASM with GridCore back-end (gRPC)

Grid dimensions

Index

The default grid configuration allows the broswer to calculate its height and width.

You can configure the column width using the SetWidth method of the column definition object as follows:

   Columns.Add(o => o.CompanyName).SetWidth(220);
   Columns.Add(o => o.ContactName).SetWidth("20%");
   Columns.Add(o => o.Address).SetWidth("25em");
     

But you can also configure the grid height and width using the SetTableLayout method of the GridClient object:

    var client = new GridClient<Order>(gridClientService.GetOrdersGridRows, query, false, "ordersGrid", Columns)
        .SetTableLayout(TableLayout.Fixed, "1200px", "400px");

The SetTableLayout method has 3 parameters, one of them is required:

Parameter Description
tableLayout enum to enable fixed dimensions (required)
width string to define the grid width (optional). The default value is "auto"
height string to define the grid height (optional). The default value is "auto"

It's recommended to configure the width of all collumns using the SetWidth method. If you don't do it, the default column width (12em) will be applied.

Scrollbars will be added automatically by the grid component in case it will be necessary.

<- Export to Excel | Virtualization ->