Intersoft WebGrid Documentation
ColumnSets Property
See Also  Example Send Feedback
ISNet.WebUI.WebGrid Namespace > WebGridTable Class : ColumnSets Property






Gets or sets a set of columns and rows as one row layout.

Syntax

Visual Basic (Declaration) 
<BrowsableAttribute(False)>
<ISNet.Serialization.XmlSerializableAttribute()>
<ISNet.Serialization.BinarySerializableAttribute()>
<NotifyParentPropertyAttribute(True)>
<DefaultValueAttribute()>
<PersistenceModeAttribute(PersistenceMode.InnerProperty)>
<DescriptionAttribute()>
Public ReadOnly Property ColumnSets As WebGridColumnSetCollection
Visual Basic (Usage)Copy Code
Dim instance As WebGridTable
Dim value As WebGridColumnSetCollection
 
value = instance.ColumnSets
C# 
[BrowsableAttribute(false)]
[ISNet.Serialization.XmlSerializableAttribute()]
[ISNet.Serialization.BinarySerializableAttribute()]
[NotifyParentPropertyAttribute(true)]
[DefaultValueAttribute()]
[PersistenceModeAttribute(PersistenceMode.InnerProperty)]
[DescriptionAttribute()]
public WebGridColumnSetCollection ColumnSets {get;}
Delphi 
public read-only property ColumnSets: WebGridColumnSetCollection; 
JScript 
BrowsableAttribute()
ISNet.Serialization.XmlSerializableAttribute()
ISNet.Serialization.BinarySerializableAttribute()
NotifyParentPropertyAttribute()
DefaultValueAttribute()
PersistenceModeAttribute(PersistenceMode.InnerProperty)
DescriptionAttribute()
public function get ColumnSets : WebGridColumnSetCollection
Managed Extensions for C++ 
[BrowsableAttribute(false)]
[ISNet.Serialization.XmlSerializableAttribute()]
[ISNet.Serialization.BinarySerializableAttribute()]
[NotifyParentPropertyAttribute(true)]
[DefaultValueAttribute()]
[PersistenceModeAttribute(PersistenceMode.InnerProperty)]
[DescriptionAttribute()]
public: __property WebGridColumnSetCollection* get_ColumnSets();
C++/CLI 
[BrowsableAttribute(false)]
[ISNet.Serialization.XmlSerializableAttribute()]
[ISNet.Serialization.BinarySerializableAttribute()]
[NotifyParentPropertyAttribute(true)]
[DefaultValueAttribute()]
[PersistenceModeAttribute(PersistenceMode.InnerProperty)]
[DescriptionAttribute()]
public:
property WebGridColumnSetCollection^ ColumnSets {
   WebGridColumnSetCollection^ get();
}

Example

The following sample codes show you how to create columnset programmatically,
C#Copy Code
//Configure the RowLayout property of the RootTable into ColumnSet.
     WebGrid1.RootTable.RowLayout = RowLayoutMode.ColumnSet;

     //Construct the first ColumnSet object including Caption, Name and ColumnCount property. 
     WebGridColumnSet oColumnSet = new WebGridColumnSet();
     oColumnSet.Caption = "Left-ColumnSet";
     oColumnSet.Name = "ColumnSet0";
     oColumnSet.ColumnCount = 4;

     //Add the ColumnSet object into the ColumnSet collection of the RootTable.
     WebGrid1.RootTable.ColumnSets.Add(oColumnSet);

     //Obtain the WebGridRowLayoutCollection object from WebGridColumnSet.Layout. 
     WebGridRowLayoutCollection oRowLayouts = oColumnSet.Layout;

     //Create an instance of WebGridRowLayout. An instance of WebGridRowLayout object denotes a cell in the matrix of the ColumnSet.
     WebGridRowLayout oRowLayout = new WebGridRowLayout();

     //Set the cell at (0,0) to be filled with a column. 
     oRowLayout.Col = 0;
     oRowLayout.Row = 0;
     oRowLayout.ColumnMember = "CompanyName";

     //Add the cell into the WebGridRowLayoutCollection. 
     oRowLayouts.Add(oRowLayout);

Remarks

WebGrid.NET’s ColumnSets 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.

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. You can also resize the cell’s width and height visually.

There are three benefits of ColumnSets:

  • 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 lengthy 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.

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.