Intersoft WebGrid Documentation
WebGridColumnSet Class
Members  Example  See Also  Send Feedback
ISNet.WebUI.WebGrid Namespace : WebGridColumnSet Class






Represents a set of columns and rows to create one row layout in a WebGridTable object. WebGridColumnSet is implemented from unique row rendering mechanism.

Object Model

WebGridColumnSet Class

Syntax

Visual Basic (Declaration) 
<PersistenceModeAttribute(PersistenceMode.InnerProperty)>
<DescriptionAttribute()>
<SerializableAttribute()>
Public Class WebGridColumnSet 
   Inherits ISNet.WebUI.NamedObjectBase
   Implements ISNet.ICopyable, ISNet.IResetable, ISNet.Serialization.BinarySerialization.IBinarySerialize, ISNet.WebUI.INamedObject 
Visual Basic (Usage)Copy Code
Dim instance As WebGridColumnSet
C# 
[PersistenceModeAttribute(PersistenceMode.InnerProperty)]
[DescriptionAttribute()]
[SerializableAttribute()]
public class WebGridColumnSet : ISNet.WebUI.NamedObjectBase, ISNet.ICopyable, ISNet.IResetable, ISNet.Serialization.BinarySerialization.IBinarySerialize, ISNet.WebUI.INamedObject  
Delphi 
public class WebGridColumnSet = class(ISNet.WebUI.NamedObjectBase, ISNet.ICopyable, ISNet.IResetable, ISNet.Serialization.BinarySerialization.IBinarySerialize, ISNet.WebUI.INamedObject)
JScript 
PersistenceModeAttribute(PersistenceMode.InnerProperty)
DescriptionAttribute()
SerializableAttribute()
public class WebGridColumnSet extends ISNet.WebUI.NamedObjectBase implements ISNet.ICopyable, ISNet.IResetable, ISNet.Serialization.BinarySerialization.IBinarySerialize, ISNet.WebUI.INamedObject 
Managed Extensions for C++ 
[PersistenceModeAttribute(PersistenceMode.InnerProperty)]
[DescriptionAttribute()]
[SerializableAttribute()]
public __gc class WebGridColumnSet : public ISNet.WebUI.NamedObjectBase, ISNet.ICopyable, ISNet.IResetable, ISNet.Serialization.BinarySerialization.IBinarySerialize, ISNet.WebUI.INamedObject  
C++/CLI 
[PersistenceModeAttribute(PersistenceMode.InnerProperty)]
[DescriptionAttribute()]
[SerializableAttribute()]
public ref class WebGridColumnSet : public ISNet.WebUI.NamedObjectBase, ISNet.ICopyable, ISNet.IResetable, ISNet.Serialization.BinarySerialization.IBinarySerialize, ISNet.WebUI.INamedObject  

Example

The code below will show you how to create WebGridColumnSet programmatically.
C#Copy Code
private void CreateColumnSet()
{
 WebGrid1.RootTable.RowLayout = RowLayoutMode.ColumnSet;

 WebGridColumnSet oColumnSet = new WebGridColumnSet();
 oColumnSet.Caption = "ColumnSet0";
 oColumnSet.Name = "ColumnSet0";
 oColumnSet.ColumnCount = 4;

 WebGrid1.RootTable.ColumnSets.Add(oColumnSet);

 WebGridRowLayoutCollection oRowLayouts = oColumnSet.Layout;
 WebGridRowLayout oRowLayout = new WebGridRowLayout();

 oRowLayout.Col = 0;
 oRowLayout.Row = 0;
 oRowLayout.ColumnMember = "CompanyName";
 oRowLayouts.Add(oRowLayout);

 oRowLayout = new WebGridRowLayout();
 oRowLayout.Col = 1;
 oRowLayout.Row = 0;
 oRowLayout.ColumnMember = "ContactName";
 oRowLayouts.Add(oRowLayout);

 oRowLayout = new WebGridRowLayout();
 oRowLayout.Col = 2;
 oRowLayout.Row = 0;
 oRowLayout.ColumnMember = "ContactTitle";
 oRowLayouts.Add(oRowLayout);

 oRowLayout = new WebGridRowLayout();
 oRowLayout.Col = 3;
 oRowLayout.Row = 0;
 oRowLayout.ColumnMember = "Phone";
 oRowLayouts.Add(oRowLayout);

 oRowLayout = new WebGridRowLayout();
 oRowLayout.Col = 0;
 oRowLayout.Row = 1;
 oRowLayout.ColumnMember = "Country";
 oRowLayouts.Add(oRowLayout);

 oRowLayout = new WebGridRowLayout();
 oRowLayout.Col = 1;
 oRowLayout.ColSpan = 3;
 oRowLayout.Row = 1;
 oRowLayout.ColumnMember = "Address";
 oRowLayouts.Add(oRowLayout);

 oRowLayout = new WebGridRowLayout();
 oRowLayout.Spanned = RowLayoutSpan.Column;
 oRowLayout.Col = 1;
 oRowLayout.Row = 1;
 oRowLayouts.Add(oRowLayout);

 oRowLayout = new WebGridRowLayout();
 oRowLayout.Spanned = RowLayoutSpan.Column;
 oRowLayout.Col = 2;
 oRowLayout.Row = 1;
 oRowLayouts.Add(oRowLayout);

 oRowLayout = new WebGridRowLayout();
 oRowLayout.Spanned = RowLayoutSpan.Column;
 oRowLayout.Col = 3;
 oRowLayout.Row = 1;
 oRowLayouts.Add(oRowLayout);

 WebGridColumnSet oColumnSet1 = new WebGridColumnSet();
 oColumnSet1.Caption = "ColumnSet1";
 oColumnSet1.Name = "ColumnSet1";
 oColumnSet1.ColumnCount = 2;

 WebGrid1.RootTable.ColumnSets.Add(oColumnSet1);
 WebGridRowLayoutCollection oRowLayouts1 = oColumnSet1.Layout;
 WebGridRowLayout oRowLayout1;

 oRowLayout1 = new WebGridRowLayout();
 oRowLayout1.Col = 0;
 oRowLayout1.Row = 0;
 oRowLayout1.RowSpan = 2;
 oRowLayout1.ColumnMember = "Fax";
 oRowLayouts1.Add(oRowLayout1);

 oRowLayout1 = new WebGridRowLayout();
 oRowLayout1.Col = 1;
 oRowLayout1.Row = 0;
 oRowLayout1.RowSpan = 2;
 oRowLayout1.ColumnMember = "Region";
 oRowLayouts1.Add(oRowLayout1);

 oRowLayout1 = new WebGridRowLayout();
 oRowLayout1.Col = 0;
 oRowLayout1.Row = 1;
 oRowLayouts1.Add(oRowLayout1);

 oRowLayout1 = new WebGridRowLayout();
 oRowLayout1.Col = 1;
 oRowLayout1.Row = 1;
 oRowLayouts1.Add(oRowLayout1);
}

Remarks

One of the most powerful and innovative features that had been added in WebGrid.NET v5.0 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.

WebGridColumnSet 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. For more information you can read ColumnSets Layout.

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.

You can configure ColumnSet using Designer. From WebGrid.NET Designer, select Table, select ColumnSets node then click on ColumnSet Designer in right pane.

ColumnSet Designer Features:

  • Resize cell's width and height by using drag and drop.
  • Rich layout object model, allow you to access properties of specific cell in RowLayout Properties.
  • Allow unbound and empty cell.
  • Conveniently assign column member by clicking on drop-down arrow or right click on active cell.

 

Benefits

WebGridColumnSet has following benefits:

Easy To Use.
The provided Designer enables developers to easily design the layout they wanted, without advanced knowledge of HTML.
Time Saving.
The ColumnSet Layout can be quickly configured and work consistently with other 85+ features. There is no need to waste long hours to construct TABLE, nested DIV, or other complex layout which requires advanced HTML knowledge. There is no need to use slower Template Editing designer too.
Accessible Objects.
You can access the ColumnSet and the RowLayout objects easily in both server side and client side codes by using strongly-typed API. You can't do this with .NET Template since it required you to construct your own TABLE and therefore have no integration with other features.

Please note that frozen columns in the column freezing feature can not work together with ColumnSet layout, since ColumnSet layout does not have suitable display and purpose to be applicable for Column Freezing feature.

Inheritance Hierarchy

System.Object
   ISNet.WebUI.WebUIBaseClass
      ISNet.WebUI.NamedObjectBase
         ISNet.WebUI.WebGrid.WebGridColumnSet

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

©2012 Intersoft Solutions Corp. All Rights Reserved.