HomeCommunityControl GalleryData & XMLMaster-DetailHierarGrid

HierarGrid



(2) Submit a Review

8,538 Downloads

61,343 Views


Description

The HierarGrid is a DataGrid-like control that is capable of displaying parent-child relations using templates to display the child elements.

This control is free and includes source code.

Alternative Download:
http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=72c83402-51e6-4b6b-96ee-c3db57e4fa55

Tutorial:
http://www.aspalliance.com/denisb/Articles/HierarGrid.aspx

Syntax Example

private void Page_Load(object sender, System.EventArgs e) { if(!IsPostBack) { DataSet ds = new DataSet(); ds.ReadXml(AppDomain.CurrentDomain.BaseDirectory + @"\Testdata.xml"); DataColumn dc1; DataColumn dc2; //Relation Title => Author dc1 = ds.Tables[0].Columns["title_id"]; dc2 = ds.Tables[1].Columns["title_id"]; DataRelation dr = new DataRelation("Title_Author", dc1, dc2, false); ds.Relations.Add(dr); //Realtion Title => Sales dc1 = ds.Tables[0].Columns["title_id"]; dc2 = ds.Tables[2].Columns["title_id"]; dr = new DataRelation("Title_Sales", dc1, dc2, false); ds.Relations.Add(dr); HG1.DataSource = ds; HG1.DataMember = "Titles"; HG1.DataBind(); } } private void HG1_TemplateSelection(object sender, HierarGridTemplateSelectionEventArgs e) { e.TemplateFilename = "Templates\\" + e.Row.Table.TableName + ".ascx"; }

Screenshots

Reviews

Submit a review

It perfectly fits my requirement

Reviewed by: thirumalai_pm on Wednesday, July 22, 2009

5 Stars

This HierarGrid control fits my project perfectly.. Thanks for giving such a great code. Only I change in the javascript code is - The first column shows the +, - buttons, When I click the buttons I dont need to show the details grid by merging all the columns in the next row, instead i need to show first column in empty with same width, and second column merges all other columns to show the grid. It works great.. Thanks Denis.

Cant get the detail grid to do CommandEvents properly..

Reviewed by: henkm on Tuesday, February 24, 2004

3 Stars

For just displaying data in the view grid it is great, but dont try to do anything involving events in it.. It wont work for 100% It wil do for 95%, and that last 5% will cost you days to find out it just cant be done with this one..