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






A collection of settings that replicate WebGrid's SelfReference feature.

Object Model

SelfReferencingSettings Class

Syntax

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

Example

The following sample codes show you how to configure Self Reference settings using code behind.
C#Copy Code
WebGrid1.RootTable.SelfReferencingSettings.Enabled = true;
WebGrid1.RootTable.SelfReferencingSettings.ParentDataMember = "EmployeeID";
WebGrid1.RootTable.SelfReferencingSettings.ChildDataMember = "ReportsTo";
WebGrid1.RootTable.SelfReferencingSettings.ExpandColumnMember = "FirstName";
The following sample codes show you how to select the child row of a specified parent row in Self Reference Grid from server side
C#Copy Code
protected void WebGrid1_InitializeRow(object sender, ISNet.WebUI.WebGrid.RowEventArgs e)
    {
        if (e.Row.Cells.GetNamedItem("FirstName").Text == "Andrew")
        {
            e.Row.ExpandSelfRefRow();
        }
        else if (e.Row.Cells.GetNamedItem("FirstName").Text == "Janet")
        {
            e.Row.Selected = true;
            WebGrid1.SetFocus();
        }
    }

Remarks

SelfReference makes a simple flat grid becomes hierarchical. It is because of the reference from one column to another based on the DataMember in it. There are numerous UI settings applicable to this feature, such as TreeView selection mode, parent root mode, AutoFit column on expand, and more.

WebGrid.NET 5.0 Enterprise allows you to display self referencing hierarchical table settings. WebGrid.NET’s SelfReference feature is unique, since that it is implemented as an entirely new feature and therefore does not exclude any other features. Consequently you can still enable normal Hierarchical mode along with the SelfReferencing feature, enabling sophisticated and never-possible-before scenarios to be implemented easily. As part of WebGrid.NET’s vision, the feature also supports LoadOnDemand capability which built on the top of the OnTheFly™ architecture.  

Our self referencing table's concept is this table shares the same table structure and is not a "real" hierarchical drill-down mode. We only see the self referencing mode as another way to group and order the data in a way that follow specific constraints (that is ParentDataMember and ChildMember) to produce a convenient, well-ordered and expandable structure of rows. Therefore, WebGrid.NET's powerful Hierarchical mode is not conflicted and can be enabled along with self referencing mode.

On version 5.0, the Self Reference feature has the ability to select the child row of a specified parent row in Self Reference Grid from server side (Like shown in the example above). For more information you can read Walkthrough: Creating Self Reference WebGrid.

Inheritance Hierarchy

System.Object
   ISNet.WebUI.WebUIBaseClass
      ISNet.WebUI.WebGrid.SelfReferencingSettings

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.