SelfReference Table


Introduction


Version 4.0 is now able to display self referencing hierarchical table by simply configuring the settings through WebGrid.NET Designer.


WebGrid.NET’s SelfReference feature is unique, in that it is implemented as an entirely new feature and therefore does not sacrifice any of the other features.


Therefore you can still have normal Hierarchical mode along with the SelfReferencing feature, creating sophisticated and never-before scenarios that can be implemented easily.


As part of WebGrid.NET’s vision, the feature also supports LoadOnDemand capability built on the top of the OnTheFly architecture.


This allows developers to implement their own logic to fetch large data tables.


Our self referencing table concept can actually share the same table structure and is not a "real" hierarchical drill-down mode. With it you can group and order the data in a way that follows 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 does not conflict and can be enabled along with self referencing mode.


The child and parent recursive implementation is fully based on ADO.NET mechanism. That means if you apply the same child and parent member setting to ADO.NET, you will get the same results.


LoadOnDemand Implementation


Load on demand feature enables you to retrieve the child rows when the specific parent mode is clicked.


This flexible feature allows a larger data table to be retrieved efficiently.


When working in load on demand mode, the first page load will only populate the parent rows and hence you only need to supply the parent rows datasource.


Next, you need to implement InitializeSelfReferenceDataSource server event to handle the process of retrieving childrows datasource.


In any event, you only need to fill the childrows into the datatable as shown in the sample below, the grid will be able to automatically populate the childrows without additional codes.