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






As the main object of the control, WebGrid.NET contains LayoutSet which provide a centralized access to customize most of the WebGrid's styles and behavior. You can control the styles, appearances, and behavior of the WebGrid by configuring the LayoutSettings such as AllowAddNew, AllowColumnMove, AllowGrouping, AllowFilter, and so on. Users can achieve the styles and behavior based on what they want effectively and conveniently using our powerful and easy-to-use Designer. 

Object Model

LayoutSet Class

Syntax

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

Example

The following example shows you how to control the behavior and styles of a WebGrid programmatically.
C#Copy Code
private void WebGrid1_InitializeDataSource(object sender, ISNet.WebUI.WebGrid.DataSourceEventArgs e)
{
    DataSet ds = new DataSet();
    oleDbDataAdapter1.Fill (ds);
    e.DataSource = ds;
}

private void WebGrid1_InitializeLayout(object sender, ISNet.WebUI.WebGrid.LayoutEventArgs e)
{
    WebGrid1.LayoutSettings.AllowSorting =  ISNet.WebUI.WebGrid.Sorting.Yes;
    WebGrid1.LayoutSettings.AllowEdit = ISNet.WebUI.WebGrid.Edit.Yes;
    WebGrid1.LayoutSettings.AllowAddNew = ISNet.WebUI.WebGrid.AddNew.Yes;
    WebGrid1.LayoutSettings.AllowFilter = ISNet.WebUI.WebGrid.Filter.Yes;
    WebGrid1.LayoutSettings.FilterBarVisible =  true;
    WebGrid1.LayoutSettings.AllowGrouping = ISNet.WebUI.WebGrid.Grouping.Yes;
    WebGrid1.LayoutSettings.GroupByBoxVisible = true;
}

Remarks

LayoutSet enables full automated WebGrid's data processing which allow developers to create a highly functional data presentation's application in less time and codes. The automated data processing could be in column sorting, column grouping/ungrouping/change group order, and column filtering.

WebGrid.NET Enterprise 5.0 provides several new properties, such as AllowColumnFreezing, AutoFilterSuggestionFreezePaneSettings, and ShowFilterStatus

LayoutSet contains numerous Styles that control the appearance of the WebGrid. You can customize all parts of the WebGrid's UI Element to best suit your application's needs. You can easily set the styles in design-time without any knowledge needed in DHTML, Scripts or CSS syntax.

In order to Sort column, users simply need to click on the column header after the AllowSorting property in LayoutSettings has been set to True. The sort order of subsequent click is, Ascending, Descending and then back to None. Users can also sort multiple columns by pressing SHIFT key when click on column header. Alternatively, user can also do the sort selectively by right clicking on the column header and select on either Sort Ascending or Sort Descending.

In order to Filter data, users can specify row filter based on a column by typing the filter text in Filter TextBox and press ENTER after the AllowFilter property in LayoutSettings is set to True. You can change the filter type, apply all filters, or clear all filters by clicking the Filter Image. WebGrid.NET Enterprise 5.0 provides new feature AutoFilterSuggestion. Using this feature users able to filter data without typing any letter in the filter bar.

If you want to enable Grouping, you need to set the AllowGrouping in LayoutSettings to True. A column can be grouped by right clicking on the column header and clicking on Group By This Field. Alternatively, users can drag the column and drop it in GroupBox. On the other hand, you can ungroup column by right clicking on the column header and clicking on Ungroup By This Field. Users can also ungroup a column by dragging the group column's object and drop it in Table's column headers or just drop it in any Grid's area to remove the column from view. You can also change order of group column. The order of grouped column can be changed by dragging the group column's object and move it to targeted position. A column pointer image will appear when the mouse cursor is over a valid position.

WebGrid.NET Enterprise 5.0 presents new user interface such as new icon-sets, new context menu engine and styles, as well as new “Elegant” style. These new features help end users to interact with information better with a Grid which is not only powerful in functions, but appealing to eyes and experience as well.

Inheritance Hierarchy

System.Object
   ISNet.WebUI.WebUIBaseClass
      ISNet.WebUI.WebGrid.LayoutSet

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.