Intersoft WebGrid Documentation
ColumnSets Layout
See Also Send comments on this topic.
Intersoft WebGrid > WebGrid Features Overview > Layouting > ColumnSets Layout

Glossary Item Box

This topic contains the following sections:

Introduction

One of the most powerful and innovative features in the WebGrid is the new row rendering engine, which is now capable to render a subset of cells and rows as one row unit. The unique row rendering mechanism enables implementation of features such as ColumnSets and PreviewRow without breaking the consistency with existing features and APIs. The subset of cells and rows are rendered in the same table hierarchy resulting in approximately faster performance and about 25% smaller output size compared to other grids which normally render "nested tables" for each subset of rows such as grouprow, columnsets row, and previewrow or selfreference childrow.

WebGrid's ColumnSet is built on the top of rich object model called RowLayout. This allows true cell layouting without dependency to column object. It also enables you to construct the layout dynamically from your codes, for even greater flexibility!

You can enable columnset rowlayout rendering in any level of table without has to sacrifice existing features such as hierarchical, grouping, column footer, group totaling, add/edit/delete, filtering, keyboard navigation, automatic column width, exporting and so on.

Powerful and easy-to-use designer is also included. Our unique designer has been developed to let you easily and conveniently design the columnsets. You can also resize the cell's width and height visually.

Benefits

The ColumnSet feature is designed to replace the standard .NET Templating approach which introduced following benefits:

ColumnSet Designer

Access to ColumnSet Designer from WebGrid Designer, Table, select ColumnSets node then click on ColumnSet Designer in right pane.

ColumnSet Designer Features:

RowLayout Concept and client's API


Without breaking existing API, the ColumnSet feature is built into the same, single structure which offered smaller output size and faster performance. WebGrid's row concept is an individual row element for each rowitem such as grouprow, columnsets or previewrow.

You may have already familiar with WebGrid's client side API such as getting selected row, retrieving keyValue, retrieving specific cell's information and so on. In ColumnSet mode, all row's attributes are only rendered in first row of each subset of rows to avoid duplication, named RootRow. The selected row will consistently reflect to the currently selected sub row of columnset rows (see screenshot above), so you may need to retrieve the RootRow in order to get information about a row.

Sample - Retrieving information of selected row (based on screenshot above) 

C# Copy Code
var grid = ISGetObject("Webgrid1");
var selRow = grid.GetSelectedObject().GetSelectedRow();
 
alert(selRow.keyValue); // return undefined
alert(selRow.rowIndex); // return 4
 
var rootRow = wgGetRootRow(selRow);
 
alert(rootRow.keyValue); // return "2"
alert(rootRow.rowIndex); // return 3
 
var homePhoneCell = wgGetCellByName(rootRow, "HomePhone");
alert(homePhoneCell.innerText); // return "206 555-9857"
 
// get columnset rows
var colSetRows = wgGetColumnSetRows(rootRow);
alert(colSetRows.length); // return 3

ColumnSet Settings

ColumnSet settings is attached per table and can be found in expandable ColumnSetSettings property. You can customize numerous setting such as GridLineColor, GridLines, GridLineStyle, RowCount and ShowHeaders.

 

Accessing ColumnSet in Client-side

The entire ColumnSet ClientSide script has been completely reworked to provide object oriented API instead of using Global Functions like in previous versions. With this new client side object models, developers can now easily extend our WebGrid component to deliver greater values by adding more user interactive features as well as achieving complex business logic scenarios.

Here are some samples code using WebGrid.NET client side API :

 

Using ColumnSet in ChildTable

The ColumnSet feature is not limited on RootTable only. You can also configure the Child Table to use ColumnSet Layout while still having the rest features to work in harmony.

Creating Hierarchical ColumnSet is similar with the common process of creating normal HierarchicalStructure of the grid.

ColsEt


These are the guides :

Customizing ColumnSet Settings

Known as a rich feature component, Intersoft WebGrid.NET ColumnSet has many settings that can be attached to each table and can be found in expandable ColumnSetSettings property. We can customize numerous setting such as GridLineColor, GridLines, GridLineStyle, RowCount and ShowHeaders.

This is the snapshot of WebGrid.NET Designer showing the ColumnSet Settings.

DEsigner

When we set the ColumnSet Settings as above, the ColumnSet grid will be shown like below snapshot, look at the red dotted line on every horizontal GridLine.

Setting

See Also

©2012 Intersoft Solutions Corp. All Rights Reserved.