Tuesday, February 19, 2008

HierarGrid - A hierarchical DataGrid that displays master-detail relations

 

Problem:

The ASP.NET DataGrid is a popular control to display data in a table form with editing, paging and sorting capabilites.
However it is only suitable to display single DataTables - there is no support for parent-child relations.

Goal:

To create a control that provides the standard DataGrid functionality and at the same time can display parent-child relations using templates to display the child elements.

Procedure:

Create a custom control called HierarGrid that derives from the DataGrid and a custom DataGridColumn called HierarColumn.

The HierarGrid takes a DataSet that contains relations between the tables.

While iterating over the parent table it checks the related tables for child rows and if one is found it dynamically loads a template for the child

row(s)

The template is rendered invisibly into the custom HierarColumn and when the user clicks the plus icon, the template content is copied via JavaScript into a newly created TableRow.

Download (V2.2):
How to get started:

By Denis Bauer

2 comments:

youtubeline said...

for this video

net grid said...

I like your blog on hierarchical grid that displays master detail relations .for more information on hierarchical grid visit on http://dapfor.com/en/net-suite/net-grid/features/hierarchical-data-binding I got many important tips and ideas today from your blog. Thanks.

Post a Comment