With more styles and appearance customizability, automatic columns fitting, condition-based formatting and more, WebGrid.NET SelfReference introduce a TreeView selection mode which will make application development easier, for example : Outlook 2003, Support Management System, Discussion Board.

In order to make a grid with TreeView selection mode, we need to set the IsTreeViewSelectionMode to true. Please check sample code belows:
| C# | Copy Code |
WebGrid1.RootTable.SelfReferencingSettings.Enabled = true;
WebGrid1.RootTable.SelfReferencingSettings.ParentDataMember = "FolderID";
WebGrid1.RootTable.SelfReferencingSettings.ChildDataMember = "ParentFolderID";
WebGrid1.RootTable.SelfReferencingSettings.ExpandColumnMember = "Name";
WebGrid1.RootTable.SelfReferencingSettings.IsTreeViewSelectionMode=True;
WebGrid1.RootTable.SelfReferencingSettings.ParentRootMode =
ISNet.WebUI.WebGrid.ParentRootMode.UseParentRootValue;
|
|
This is the result of the TreeView mode sample using SelfReference feature of WebGrid :

Getting Started
Getting Started
Overview
WebGrid Features Overview
Other Resources
Walkthrough Topics
How-to Topics
Copy Code