HierarGrid: A Hierarchical DataGrid that Displays Master-Detail Relationships
page 1 of 2
Published: 17 Oct 2003
Unedited - Community Contributed
Abstract
This article explains how to use the HierarGrid, a hierarchical DataGrid that displays master-detail relationships.
by Denis Bauer
Feedback
Average Rating: 
Views (Total / Last 10 Days): 165573/ 273

Using the HierarGrid - Part I

1 What is the HierarGrid

The ASP.NET DataGrid is a popular control for displaying tabular data, with editing, paging and sorting capabilities. However, this is only suitable for displaying single DataTables - there is no support for master-detail views using parent-child relations.

I have created a custom control called HierarGrid (that derives from the standard ASP.NET DataGrid) and a custom DataGridColumn called HierarColumn.

The HierarGrid takes a DataSet containing relations between tables as its DataSource.

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's content is copied via JavaScript into a newly created TableRow.

Sample illustration (Fig. 1):

HierarGrid sample

2 Where can I download the HierarGrid

I have published the HierarGrid, including the source code, on my homepage http://www.denisbauer.com/ASPNETControls.aspx

Please also note the demo that I created, which can be downloaded from the same location. The following explanations are mainly based on, and refer to this demo.

The HierarGrid can be used and distributed at no charge in non-commercial and commercial projects. However I am happy to hear about any feedback, suggestions, improvements, criticisms, etc.

3 How to use the HierarGrid

3.1 Loading the data into a DataSet

The .NET Framework offers multiple ways to load data into a DataSet. One possible way is to use a SQLCommand to run a SQL query against a table in MS SQL Server. In my example, I used the "Pubs" database, a sample Database of Microsoft SQL Server. I created three SELECT statements that returned a list of publications, the associated authors and the sales in separate tables. The resulting DataSet can be written to a XML file using the method ds.WriteXml. The XML file is contained in the sample application as Testdata.XML, which can be downloaded from the link above.

To load the sample data yourself add two Views and a stored procedure into the "Pubs" database with the following three SQL statements:

CREATE VIEW dbo.VwAuthors
AS
SELECT  dbo.authors.*, dbo.titleauthor.title_id
FROM  dbo.titleauthor INNER JOIN
  dbo.authors ON dbo.titleauthor.au_id = dbo.authors.au_id
ORDER BY dbo.titleauthor.title_id


CREATE VIEW dbo.VwSales
AS
SELECT  dbo.sales.title_id, dbo.stores.stor_name, 
  dbo.stores.stor_address, dbo.stores.city, dbo.stores.state,
  SUM(dbo.sales.qty) AS qty, dbo.stores.zip
FROM  dbo.sales INNER JOIN
  dbo.stores ON dbo.sales.stor_id = dbo.stores.stor_id
GROUP BY dbo.sales.title_id, dbo.stores.stor_name, 
  dbo.stores.stor_address, dbo.stores.city, dbo.stores.state,
  dbo.stores.zip
ORDER BY dbo.sales.title_id


CREATE PROCEDURE dbo.TestData AS
SELECT  title_id as Title_ID, title as Title, type as Type, 
  price as Price, notes as Notes, 
  CAST(pubdate as varchar) as Publication
FROM  Titles

SELECT  *
FROM  VwAuthors 
WHERE    exists (Select * from Titles where au_id = VwAuthors.au_id) 
ORDER BY title_id

SELECT *
FROM  VwSales
WHERE  exists (Select * from Titles where title_id = VwSales.title_id)

To load the data into a DataSet create a new WebApplication and add the following code into the Page_Load event:

[VB]
Dim sqlConnection As SqlConnection = New SqlConnection()
Dim sqlCommand As SqlCommand = New SqlCommand()

sqlConnection.ConnectionString = 
 "data source=(local);initial catalog=pubs;integrated security=SSPI;"
sqlCommand.CommandText = "[TestData]"
sqlCommand.CommandType = System.Data.CommandType.StoredProcedure
sqlCommand.Connection = sqlConnection
Dim ds As DataSet = New DataSet()

sqlConnection.Open()
Dim adap As SqlDataAdapter = New SqlDataAdapter(sqlCommand)

adap.Fill(ds)
sqlConnection.Close()

ds.Tables(0).TableName = "Titles"
ds.Tables(1).TableName = "Authors"
ds.Tables(2).TableName = "Sales"

[C#]
SqlConnection sqlConnection = new SqlConnection();
SqlCommand sqlCommand = new SqlCommand();

sqlConnection.ConnectionString = 
 "data source=(local);initial catalog=pubs;integrated security=SSPI;";
sqlCommand.CommandText = "[TestData]";
sqlCommand.CommandType = System.Data.CommandType.StoredProcedure;
sqlCommand.Connection = sqlConnection;
DataSet ds = new DataSet();

sqlConnection.Open();
SqlDataAdapter adap = new SqlDataAdapter(sqlCommand);

adap.Fill(ds);
sqlConnection.Close();

ds.Tables[0].TableName = "Titles";
ds.Tables[1].TableName = "Authors";
ds.Tables[2].TableName = "Sales"; 

3.2 Binding the Data to a standard DataGrid

Alternatively to the steps mentioned in the section above, you can download the sample project and use the Testdata.XML file. This file can be loaded into a DataSet and bound to a standard DataGrid with only a few lines of code.

If you had not already done in step 3.1 create a new WebApplication and drop a new DataGrid from the toolbar onto the webform and call it DG1. Otherwise skip the next few lines and continue with binding your retrieved DataSet to the DataGrid.

The following code shall be placed in the Page_Load event.

The first step is to load the data from the sample file into a DataSet or to use the DataSet generated with the code above:

 [VB]
Dim ds as DataSet = new DataSet()
ds.ReadXml(AppDomain.CurrentDomain.BaseDirectory + "\\Testdata.xml")

[C#]
DataSet ds = new DataSet();
ds.ReadXml(AppDomain.CurrentDomain.BaseDirectory + @"\Testdata.xml");

Then the DataSet can be bound to a standard DataGrid that has been dropped on a webform:

[VB]
DG1.DataSource = ds
DG1.DataMember = "Titles"
DG1.DataBind()

[C#]
DG1.DataSource = ds;
DG1.DataMember = "Titles";
DG1.DataBind();

The procedure so far is the normal way to bind relational data from a DataSet to an ASP.NET DataGrid and can be looked up in the .NET Framework documentation and Quickstart tutorials. Following are the changes described the HierarGrid requires to display parent-child relations.

3.3 Switching to the HierarGrid

One goal when developing the HierarGrid was to enable developers to switch seamlessly between the standard DataGrid view without parent-child relations and the detailed view with the HierarGrid.

First, reference the HierarGrid.dll in your VS.NET solution by right-clicking on References, choosing Add and selecting the DLL.

Second, add the following declaration to the top of the ASPX file:

<%@ Register TagPrefix="DBWC" Namespace="DBauer.Web.UI.WebControls" 
Assembly="DBauer.Web.UI.WebControls.HierarGrid" %>

Now, you just have to change the declaration in the ASPX file from

<asp:DataGrid id="DG1" runat="server">
to
<dbwc:HierarGrid id="HG1" runat="server">

Furthermore please keep in mind to change the code-behind file as well:

[VB]
Protected WithEvents HG1 As DBauer.Web.UI.WebControls.HierarGrid

[C#]
protected DBauer.Web.UI.WebControls.HierarGrid HG1;

Restarting your application should show that nothing has changed so far. The HierarGrid behaves just like the normal DataGrid does.


View Entire Article

User Comments

Title: DataBinder.Eval Error   
Name: Kevin
Date: 2012-09-28 1:05:58 PM
Comment:
text='<%# DataBinder.Eval(((DataGridItem)Container).DataItem, "ITEMNMBR") %>'>

erroring with
DataBinding: 'System.Data.DataSet' does not contain a property with the name 'ITEMNMBR'.

To runmd What did you do to get this to go away, you fixed your problem but did not say how you fixed it.
Title: Not working at all   
Name: Kevin
Date: 2012-09-28 12:38:49 PM
Comment:
I have a webiste in VS2010 C# and this grid is not working, has anyone got this working?
Title: Grid with multiple childs faild to load with huge data   
Name: Sajid Khan
Date: 2011-07-05 8:13:27 AM
Comment:
HierarGrid with having multiple childs in hierarichi faild to load with huge data.
Title: Sorting and Paging   
Name: runmd
Date: 2011-04-28 2:40:15 PM
Comment:
I've figured out the DataBinder.Eval error a week ago when Does anyone moderate this feedback anymore? Dennis? I realized that I had the TemplateDataMode set to SingleRow instead of Table. After that, the child records bind just fine. My new issue is implementing the sorting and paging properties like it exists in the current sample at the top of this page. How do I implement this in the control so that if when I sort, I actually get the data to sort in ascending order and not just refresh the page and display the data in the same order as before.
Title: DataBinder.Eval Error   
Name: runmd
Date: 2011-04-11 3:38:28 PM
Comment:
I have two data tables in a dataset and a relation between the tables using the same field name. The child table name is passed to the TemplateSelection procedure and it appears that everything is kosher. I followed your example to the letter. I'm using this code as part of the text property of a label control within an ascx file that has the same name as the child table: Text='<%# DataBinder.Eval(CType(Container, DataGridItem).DataItem, "CONTACT_ID") %>'

This is the error that I get:
DataBinding: 'System.Data.DataSet' does not contain a property with the name 'CONTACT_ID'.

I know the data is in the dataset, but maybe it's not the right table and most likely is a syntax issue. How should I go about fixing it if it looks right so far.
Title: To select different templates on condition   
Name: Shagy
Date: 2011-03-31 4:04:48 AM
Comment:
Hi,
I am using 3 level hierargrid.But i want that for perticular condition it should show third level control at second level
Title: Applications Developer   
Name: Margaret Gaster
Date: 2011-02-07 4:12:50 PM
Comment:
I'm converting a Visual Studio application from 2003 to 2008. The HierarGrid worked correctly in 2003. Now, I continue to get "UserControl could not be loaded: _controls_price1.ascx" when I use either the page indexing feature or the Sorting feature. Can someone help out with this situation?
Title: First time + sign not expand   
Name: Ritesh
Date: 2010-11-23 5:00:40 AM
Comment:
Hi ,

I am using HierarGrid grid .When it load at first time the + (expand) button is not work.If we reload/refresh the page it works fine.
Can anyone suggest any thing?
Title: StackOverflowException   
Name: Valen
Date: 2010-07-16 3:48:58 PM
Comment:
I'm also having the same StackOverflowException problem that Antonio mentioned below, but your reply to him was to handle it in e-mail, so no solution is provided in the comments.

I'm using a DataGrid for the child data, and using C#. I've added the OnInit overrride, etc.

Any help would be great. Thanks.
Title: HierarGrid: A Hierarchical DataGrid that Displays Master-Detail Relationships   
Name: SARITA SINGH
Date: 2010-07-16 8:56:16 AM
Comment:
VERY USE FULL ARTICLE AND IT SOLVE MY PROBLEM
Title: How to download the DLL ?   
Name: KD
Date: 2010-04-27 3:20:06 AM
Comment:
I would like use the DLL and try on my code.
Please let me where can I get this DLL
Title: i need Nested Hierar Grid   
Name: shreef mekawy
Date: 2010-02-20 2:10:54 AM
Comment:
I have Areleation Between 3 Table And I need Make Nested

Please If Any One Have Example on Nested Send It to me At

shreef_mekawy@hotmail.com
shreef_mekawy@yahoo.com
Title: PAGIN PROBLEM SOLVED   
Name: Anvar Sadath
Date: 2009-10-08 12:29:03 PM
Comment:
I found what is the reason paging is not working. After changing the pageindex , you need to call the binding method once again. Call the binding method means the method which you used to lead the grid upon call.

Thnkas
Title: RE :sasha   
Name: Anvar
Date: 2009-10-08 12:15:37 PM
Comment:
In Clinic ascx file , you need to register click event while loading (page loadin) and need to write the corresponding event in the same page.
Title: HierarGrid   
Name: Jason White
Date: 2009-04-20 6:42:57 AM
Comment:
Thank you,

This looks very good. I hope to put it to use!
Title: HierarGrid   
Name: Airyce
Date: 2009-04-17 3:38:40 AM
Comment:
Whoa~ This is cool !
I like this article..I'll try to use this one ... ^_^
Title: NestedHierarGridDemo.aspx   
Name: Dante
Date: 2009-04-03 10:42:25 AM
Comment:
Dear Denis, could yo be kind to publish the NestedHierarGridDemo.aspx code. For three or more levels. Urgent please!
Title: responding to click event of a button in child grid column   
Name: sasha
Date: 2009-02-18 3:04:32 PM
Comment:
hi,
I included a button coulmn in childgrid . I want to update text in a texbox by one of the fields in child grid row when a button from that row is clicked. How to access the click event of these buttons?

thanks,
sasha
Title: want to use hierarGrid in windows C# application .net 3.0   
Name: Kirti Gupta
Date: 2009-02-02 11:52:52 PM
Comment:
Hi,
I want to use a hierarchical grid in my windows based .net 3.0 application, can u help me in using the same component in windows form or any other grid component available.
Title: Expand button(+/-) to be shown in second column   
Name: MindinCode
Date: 2009-01-16 5:37:26 AM
Comment:
Could it be possible to show the (+/-) buttons in the Second column of grid against the different data rows?
Any help regarding this would be greately appreciated.
Thanks
Title: unfortunably, this doesnt work in ie7...   
Name: kabalkunz
Date: 2008-12-10 6:55:13 PM
Comment:
i am using this excellent aproach of the hierarchical grid in asp net 2008 and works great running on ie6.
but if you try to run it on ie7... voilá... the detail-grid is not accesible...
can you give an advice about it please?
thks
Title: Expanding of Datagrid   
Name: Skapie
Date: 2008-12-10 8:40:22 AM
Comment:
I'm using HierarGrid in a updatepanel. First time I use Hg1.RowExpanded.ExpandAll(). No problem. However, when I reload the datagrid with new data, the datagrid stays in collapsed mode, even if I call "ExpandAll()". How can I get the DataGrid to stay expanded after I've reloaded with new data? Thx
Title: GridView Instead of DataGrid   
Name: Tiger
Date: 2008-11-10 8:27:19 AM
Comment:
Great Stuff.Thanks Am using the provided dll and all is working fine as documented. However, just wanted to findout if i can use a GridView instead of dataGrid?
Title: No +/- symbol   
Name: anvar
Date: 2008-10-24 11:02:58 AM
Comment:
Hierar,

Thanks for the great article.
I implemented your concept by using the compiled dll from you.
I have just modified the child grid as per my need by doing
DataRow[] childrows;
childrows = ((System.Data.DataRowView)((((DataGridItem)this.BindingContainer).DataItem))).Row.GetChildRows("Agency_Clinics");

and assigning this rows to a new datatable.
But I am not getting the +/- icon.
Can you just tell me what to do for that.
One more thing that as you wrote in your article, am not able to convert
Title: HierarGrid Multi Field Edit   
Name: Jon Steege
Date: 2008-09-19 12:53:39 PM
Comment:
Is there any chance to see a solution to Mobie question on the HierarGrid Multi Field Edit, i am having the same issue.

Thanks!
Title: Help with access controls in the child template   
Name: JB
Date: 2008-09-17 9:42:04 AM
Comment:
Could you help me out with accessing the child template. I've implemented the code on your site on how to access the child template inside the child gridview using the rowediting event.
The problem is the codes has to reside inside the user defined template. How do I retrieve the results of the selected primary keys of the parent and child gridviews?
Title: To Deepak   
Name: Daniel
Date: 2008-07-18 11:05:59 AM
Comment:
You need to create the event and add the grid as a listener.

See Section 3.7 Using the TemplateSelection event
Title: Coming back   
Name: AR
Date: 2008-07-15 12:43:23 AM
Comment:
Hey Dennis, The first time my HierarGrid page loads and works beautifully. I browse various pages from my first page and come back to this page and I click on the (+) icon and it doesnt have child rows. It is because ascx page doesnt bind the child records. When I debug this my debugger comes to
this.DataBinding += new System.EventHandler(this.BindList);
and escapes.. Doesnt actually go into the BindList function to bind child rows..Why is it???
Title: Child bind problem   
Name: Dian
Date: 2008-07-14 3:50:08 AM
Comment:
Dear Sir,

I still don't understand where is the location of:
"#region Web Form Designer generated code" to put the following code:
this.HG1.TemplateSelection += new DBauer.Web.UI.WebControls.HierarGridTemplateSelectionEventHandler(this.HG1_TemplateSelection);

cause I always got an error message when I built my apps:
"Error A get or set accessor expected"
Title: Please use the event "TemplateSelection" to specify which template to load for a child table/row   
Name: Deepak
Date: 2008-07-03 6:40:34 AM
Comment:
I am getting following error when I am trying to bind to grid

"Please use the event "TemplateSelection" to specify which template to load for a child table/row "

Please let me know the solution for this problem.
Title: To Jacob   
Name: Denis Bauer
Date: 2008-06-13 12:00:37 PM
Comment:
Hi Jacob,

please check out the EditableHierarGrid demo on my website.

Denis
Title: Editing   
Name: Jacob Ostop
Date: 2008-06-13 10:28:26 AM
Comment:
I have a question. I am trying to make the region in the template selection editable. like if they click the little button and it shows the description field i want to have a user be able to click an edit button and to make fixes/changes. would you be able to help me with that
Title: Mr.   
Name: Dhamodaran Vajiravelu
Date: 2008-06-11 5:29:25 PM
Comment:
get the following message when I try to bind to the grid:

Please use the event "TemplateSelection" to specify which template to load for a child table/row
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ComponentModel.WarningException: Please use the event "TemplateSelection" to specify which template to load for a child table/row

Source Error:


Line 39: HG1.DataSource = ds;
Line 40: HG1.DataMember = "Running";
Line 41: HG1.DataBind();
Line 42: }
Line 43:

#################################################
This is my codebehind .cs file, I think it is seeing it because it doesn't error out when picking it up, it's just not initializing it.

using System;
using DBauer.Web.UI.WebControls.HierarGrid

namespace ProductionControl.Processing {

public class HG1 :DBauer.Web.UI.WebControls {

protected DBauer.Web.UI.WebControls.HierarGrid HG1

protected void HG1_TemplateSelection(object sender, HierarGridTemplateSelectionEventArgs e)
{
e.TemplateFilename = "TABLE_1.ascx";
}


#region Web Form Designer generated code
public void InitializeComponent {
this.HG1.TemplateSelection += new HierarGridTemplateSelectionEventHandler(this.HG1_TemplateSelection);
}
end region
}
}

##########################################
I think this is the perfect control for what I need I just can't get it moving

I know this isn't a forum but if any one can help I would appreciate.

Please help damo777_143@yahoo.com or spp7dkv@ups.com
Title: Please give me full source code to display related records   
Name: Nidhi Agrawaal
Date: 2008-06-04 3:44:27 AM
Comment:
Sir,
I want to display records of two related tables (MS ACCESS ) into VB.NET form, but i don't know how to make a connectivity for related tables. I want to show records in a Datagrid ? plz. advice me to how i do that ?
Title: Export   
Name: Sweety
Date: 2008-06-03 12:57:06 AM
Comment:
Thanks heaps Dennis. Refered to your reply and got my grid working. I read in the posts that you cant export the data as it is to EXCEL. Do you have any magical methods to export the HierarGrid data. Even a simple version with no formatiing will do. Ta
Title: To Sweety and Adrian   
Name: Denis Bauer
Date: 2008-05-25 12:01:57 PM
Comment:
The question has been asked before. Please scroll down a bit to find my answer which points to the following blog post: http://www.denisbauer.com/weblog/WhyDoesTheDataItemOfMyHierarGridContainADataSetInsteadOfADataRowViewOrViceVersa.aspx

HTH
Denis
Title: Unable to cast error   
Name: Adrian Hondema
Date: 2008-05-23 1:25:16 PM
Comment:
I run into the same problem as Sweety in the previous post: Unable to cast object of type 'System.Data.DataRowView' to type 'System.Data.DataSet' in the ascx file. Is there a solution to this problem?
Thanks in advance.
Title: Mrs   
Name: Sweety
Date: 2008-05-20 1:57:54 AM
Comment:
Unable to cast object of type 'System.Data.DataRowView' to type 'System.Data.DataSet' in the ascx file on line DataSet ds = (DataSet) ((DataGridItem) this.BindingContainer).DataItem;
Please Help.
Title: Plus Icon path and set onfocus/onblur event in grid row   
Name: Andy
Date: 2008-05-15 5:20:25 AM
Comment:
Dear Denis,

Your control is nice to use. Thank for your good work

May I know how to change the Icon path or Icon image that is different from the same level of the form?

Besides, My I now how to add an onfocus/onblur/onclick even in the grid row so that I can prompt a meessage when user is click the row or on/out-of focus.

Thank a lot
Title: To Julio   
Name: Denis Bauer
Date: 2008-04-23 3:04:07 PM
Comment:
Doesn't the WinForms DataGrid/GridView already support relations? What exactly are you trying to achieve?
Title: Can this works for WindowsForms   
Name: Julio Ponce
Date: 2008-04-23 11:32:14 AM
Comment:
HEllo Denis, nice work u done with HierarGrid, I'm New to .net and I'm traying to manage a Master/Detail WindowsForm, have any Idea how can I acomplish this, or some url u can redirect to ???,
Best regards,
Julio Ponce
Title: To Mark   
Name: Denis Bauer
Date: 2008-04-03 10:06:01 AM
Comment:
I am not aware of anything you have to do specially to support more than 3 levels. What is the error message you are getting. Please send me an email.
Denis
Title: 4 levels deep with the HeirarGrid?   
Name: Mark
Date: 2008-03-30 9:29:46 PM
Comment:
Hello Dennis - used your control a number of times in the past with great success. This time, I want to nest the sucker 4 levels deep - each level being a child of the parent. Not sure why it fails on the third level on me - do I have to apply a filter somehow? I am setting the compund keys up in the dataset across all four tables...anyone ever nest it this deep before?

Thanks for the great custom control!
Title: HierarGrid   
Name: BraveHeart
Date: 2008-03-24 1:04:14 AM
Comment:
i am unable to bind the grid with child grid.
Dim dgitem As DataGridItem = CType(Me.BindingContainer, DataGridItem)
Dim dsRole As DataSet = CType(dgitem.DataItem, DataSet)

dsRole comes Null i dont know why/.
Title: HierarGrid   
Name: Bhagyalatha
Date: 2008-03-13 6:00:30 AM
Comment:
This is not completly done at server side
Title: HGrid   
Name: Rajib A.
Date: 2008-03-12 5:05:30 AM
Comment:
Great article. i did one of my own, but completely different stategy. Check it out, and let me know what you think.
Title: HGrid   
Name: Rajib A.
Date: 2008-03-11 4:56:24 PM
Comment:
Great article. i did one of my own, but completely different stategy. Check it out, and let me know what you think.

http://www.progtalk.com/ViewArticle.aspx?ArticleID=1
Title: HierarGrid   
Name: Praveen
Date: 2008-03-06 2:29:31 AM
Comment:
Hi Denis,

Its work fine
but how to get server event for child controls in Hierarchical grid,
when i tried with bubbleclick event it throwing error
Title: Binding Parent Fields in Child Templete   
Name: Austin
Date: 2008-01-01 4:42:58 AM
Comment:
hello Denis
Thanks for the control but i have some issue, I need to show fields from the parent table in child template

for filling child we use
DataBinder.Eval(((DataGridItem)Container).DataItem, "au_lname")

then how can we access parent data field to place in child template

Regards
Title: PAGING   
Name: DEV
Date: 2007-12-05 12:05:43 PM
Comment:
Hello Denis
Would you please tell me how can i make my grid to od paging?
Regards
Title: PAGING   
Name: developer
Date: 2007-12-04 1:46:38 PM
Comment:
CAN ANY ONE TELL ME Y MY PAGING IN NOT WORKING? I CAN SEE PAGE NUMBERS AND MY PAGING OPTION IS TRUE, BUT I CANT GO TO THE 2, 3 ... PAGES
ANY HELP
Title: How to Bind with Objects?   
Name: Matt
Date: 2007-11-26 5:11:03 AM
Comment:
I have found your HierarGrid and it is perfect for the application I am currently developing. However, I have my own business objects (generic collections to be precise), could you give me some advise on how I can use them to populate your control, rather than a DataSet. Particularly how to create the DataRelation.
Title: Paging not working   
Name: Max
Date: 2007-11-22 2:02:24 PM
Comment:
Has any body have solution why the paging is not working? I can see the page numbers but the grid doesnt load the second page when you click on 2
Title: HG not working on Firefox and IE 7   
Name: Developer
Date: 2007-11-16 1:12:41 PM
Comment:
Using HG into ascx control does not work in Firefox AND IE 7
Title: Datagrid filter   
Name: Sam
Date: 2007-11-05 2:20:43 PM
Comment:
Hello
Does any body know how we can filter the HierarGrid using search opption on client side? I want my grid to be redrawn on client side using that search
Title: To Luciano   
Name: Denis Bauer
Date: 2007-10-26 6:40:49 AM
Comment:
Unfortunately, there is no built-in method to optimize for printing.

Cheers
Denis
Title: Export to Excel   
Name: Luciano
Date: 2007-10-24 9:00:09 AM
Comment:
it's possible export HierarGrid data to excel ?
i tried with this method

Response.Clear()
Response.AddHeader("content-disposition", "attachment;filename=FileName.xls")

Response.Charset = ""
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.ContentType = "application/vnd.xls"
Dim stringWrite As System.IO.StringWriter = New System.IO.StringWriter
Dim htmlWrite As System.Web.UI.HtmlTextWriter = New HtmlTextWriter(stringWrite)

HgFlt.RenderControl(htmlWrite)
Response.Write(stringWrite.ToString())
Response.End()

the data were all exported but the layout was orrible...
(bad layout)

there is any tips to improve layout ?

thanks

Luciano
Title: Another one based on GridView   
Name: Jim
Date: 2007-10-20 6:44:37 PM
Comment:
Same idea, but based on ASP.Net's GridView

http://www.digitaltools.com/GVT.aspx
Title: HG used in ASCX in Firefox   
Name: Fred
Date: 2007-10-14 4:07:29 AM
Comment:
Hi,
Using HG into ascx control does not work in Firefox, it appears does not fire the event or javascript problems

rgds
Title: developer   
Name: developer
Date: 2007-09-19 1:50:44 PM
Comment:
Does any one know how we can find out which child row I am in? i have button inside the template (not in the grid columns) and want to know which child template that button clicked from?
Title: developer   
Name: developer
Date: 2007-09-12 2:59:06 AM
Comment:
Victor
Please see the following link:
http://www.denisbauer.com/ASPNETControls.aspx
Title: HG and vs2005   
Name: victor
Date: 2007-09-05 11:11:34 AM
Comment:
Hi. Excuse me. I speak English badly.
Please provide an example using HG in visual studio 2005.
lot he cares!


Thanking you in anticipation

vitema@list.ru
Title: developer   
Name: developer
Date: 2007-08-27 5:37:55 PM
Comment:
Thanx Denis, I got the image thing working for the column.
Title: developer   
Name: developer
Date: 2007-08-27 5:37:01 PM
Comment:
Is it possible to create relation in tables using two different col so i can get unique row with most matching

Regards
Title: To Developer   
Name: Denis Bauer
Date: 2007-08-27 12:46:36 PM
Comment:
Yes, this site is very alive. Regarding your question please check out just the post before yours where I point to the FAQ on my blog. There you find an article about HierarGrid and columns: http://www.denisbauer.com/weblog/DefiningTheColumnsInTheHierarGrid.aspx

HTH
Denis
Title: developer   
Name: developer
Date: 2007-08-27 10:40:08 AM
Comment:
Does this blog is still alive
Title: developer   
Name: i_am_develop
Date: 2007-08-23 11:50:59 PM
Comment:
Does any body know how to set the column header text for the column where we have +/- images?

Thanks
Title: To ShamShuddin and developer   
Name: Denis Bauer
Date: 2007-08-23 1:29:13 PM
Comment:
Basically, same answer to both of you: Just like in the regular DataGrid. The HierarGrid inherits from the DataGrid and therefore you can pretty much use the same techniques for it.

To hide or customize the columns check out this blog post: http://www.denisbauer.com/weblog/DefiningTheColumnsInTheHierarGrid.aspx

To make a row clickable there are a couple of either client or server-side solution. Please search for "clickable row datagrid" or check out the TemplateColumn.

I try to collect a couple of frequent questions on my blog in the HierarGrid category:
http://www.denisbauer.com/weblog/CategoryView,category,Software,ASP.NET,HierarGrid.aspx

Denis
Title: developer   
Name: i_am_develop
Date: 2007-08-23 1:17:57 PM
Comment:
Hey Angelo Cajipe
Did you get the answer, how to make row clickable?

Also, does anyone know how to hide the column? Basically i want to hide those columns which I am using for relation b/w parent & child table?

Thanks.
Title: nested grid   
Name: shamshuddin
Date: 2007-08-22 1:37:24 AM
Comment:
Hi

This is very good article

i use your control, but how to assign paging to child grid.
page numbers are showing correctly , but it is not going to second page.
Title: nested grid   
Name: jan
Date: 2007-08-13 5:24:19 AM
Comment:
its excellent,but i found error when i get parent row multiple. like error is "A child row has multiple parents". so i will be thankful if you posted this.
i have given relation t data key, that iam getting twice, so that time iam facing above error.
thank you
Title: devloper   
Name: Angelo Cajipe
Date: 2007-08-13 2:16:44 AM
Comment:
How can i make the parent row table clickable instead of just the plus/minus sign?
Title: Developer   
Name: mina
Date: 2007-07-29 12:12:30 PM
Comment:
It is Very Very Good artical
Title: Searching through the Parent Table   
Name: Imran
Date: 2007-07-19 2:06:31 AM
Comment:
I tried searching on the parent Table Authors ... i was trying the NestedHierarGridDemo. But When i send the querry it sends backs the record.. But the grid does not shows it..

After sometime when i removed the relationship of the dataset.. it showed over the grid.. but there was no drilldown + sign.. coz of no relationship..

I think there is an example of filtering.. but it is not a valid link.. coz when i click there is not response...

Can Anyone Help Me
Title: To Reshma & Jim White   
Name: SickPup404
Date: 2007-07-11 11:42:28 AM
Comment:
Jim White & Reshma,

I've got a WebApp using this in .NET 2.0 developed in Studio 2005 and tested both of your scenarios in the template (ASCX) codebehind page:
---------
DataGridItem dgi = (DataGridItem)this.BindingContainer;
DataSet ds = (DataSet)dgi.DataItem;
//Above two lines accomplish same thing as below.
DataSet ds = (DataSet)((DataGridItem)this.BindingContainer).DataItem;
---------
Both statements work fine in my environment. Using ASP.NET Version 2.0.50727 (in IIS site properties).

What version is showing for you? Also, what are your TemplateDataMode and TemplateCachingBase set to on the "parent" HierarGrid (ASPX) page?
Title: datagrid as a child control   
Name: Jim White
Date: 2007-06-25 3:30:30 PM
Comment:
It seems that this grid does not work well in 2.0. I had no problem getting it to work in 1.1 however, the following code return a null value when used in 2.0.

DataGridItem dgi = (DataGridItem)this.BindingContainer;

Any help would be greatly appreciated. Again, I only have problems within VS 2005. Thanks.
Title: datagrid as a child control   
Name: Reshma
Date: 2007-06-13 7:50:26 AM
Comment:
Hello,

DataSet ds = (DataSet) ((DataGridItem) this.BindingContainer).DataItem;
this doesnt work for me ....in the ascx.cs file.

Please respond..its urgent !
Title: Button in Child Grid   
Name: EEN
Date: 2007-05-12 5:37:55 PM
Comment:
Hi Dennis,

I really appreciate your efforts on creating a very useful custome control. I am using your control in one of my projects and having little trouble. I have two hierargrids in one user control and one of them has a button inside the child grid. When a button is clicked, I want to show the other hierargrid under neath. For some reason, raising an event using delegate method didn't work out. Any help would be appreciated. Thank you.
Title: Not displaying data in child grid   
Name: Anu
Date: 2007-04-11 3:45:23 PM
Comment:
I am using your grid for one of my projects, it works fine if I use Text box to display child data but when I replace text box with grid, it doesnot display any data. I am not creating data relationship manually since my xml is well formed for relational data.
Title: To CCK   
Name: Denis Bauer
Date: 2007-04-04 6:39:09 AM
Comment:
Hi,

please take a look at my blog post: http://www.denisbauer.com/weblog/TroubleshootingHierarGridPlusminusIconProblems.aspx

My email address is also listed on my website.

Maybe that helps.
Denis
Title: Not displaying +   
Name: CCK
Date: 2007-04-01 11:17:04 PM
Comment:
Hi Dennis,
I noticed that you asked the person who wrote the following to email you directly. I'm having the same problem but don't know your email.

"I'm trying out the HirarGrid control and I think its great!
However I can't get the child table and [+] images to display.

I've used another datagrid to display childrows,its not breaking the code, just xs in the + images and when I click on where the images should be it dropdown slightly with nothing in the child table datagrid"
Title: Mr   
Name: Sri
Date: 2007-02-20 12:21:46 PM
Comment:
Hi Denis
The HierarGrid is great.
I am trying to use it. Your sample, when I tested with text boxes in the UserControls, is working great.
I replced the text boxes with Grids and set the property TemplateDataMode if HG1 to Table and added the code to Page_Load of usercontrol code behind. When I ran the app. I just see an empty row being displayed when I click the + sign.
Can you please let me know where I am going wrong?
Thank you
Sri
sribun12@yahoo.com
Title: To Troy   
Name: Denis Bauer
Date: 2007-01-22 9:14:46 AM
Comment:
Hi Troy,

in general that shouldn't be a big problem but you'd have to change the HierarGrid source code. Internally, it is using Page.LoadControl(filename) to load the child templates.

HTH
Denis
Title: Possible without child ascx pages?   
Name: Troy
Date: 2007-01-20 6:45:07 PM
Comment:
First off, this is a GREAT control. Is it possible to it without individual child ascx pages? I wanted to call it from a custom control and write the templates as needed for each level depending on the number of relationships in the dataset. Thanks in advance for any advice.
Title: How to access Child Datagrid   
Name: Liz Yun
Date: 2006-12-14 7:23:21 PM
Comment:
Hi Sir,

First of all Your control is so cool.. Ive already used it once on my previous project.. and it works fine. However, Im having problems accessing the child datagrid..

I've already tried this code

Control c = dgItems.Items[Outer].Cells[1].FindControl("DCP").FindControl("Panel").FindControl("Panel_[PanelId]").FindControl("ChildTemplate_[PanelId]").FindControl("[InnerControlId]");

and i kept on getting the error message;

Object reference not set to an instance of an object.

Hope you can help me..

Many thanks,
Liz Yun
Title: Mr   
Name: smruti kanta das
Date: 2006-12-11 1:18:15 AM
Comment:
i want to create "DBauer.Web.UI.WebControls.HierarGrid.dll"
using c# language,means i want to create HierarGrid dll using c#.net
Title: Headers for the child table?   
Name: Al
Date: 2006-12-06 6:40:57 PM
Comment:
Is there a built in feature that would allow display headers for the child table as well?

Also, if the grid to be used with ASP.NET v2.0 text need to be amended (e.g [3.6 Creating a child template] event wiring is different in 2.0 and [3.7 Using the TemplateSelection event] should declare event hadling routine as [protected] instead of [private]).

But overall these are small things, the grid is great, and works just fine. Thank you!

P.S. I am still struggling using gridview to display child data; any help would be appreciated.
Title: want to get the row that was selected by the user   
Name: m ali farooq
Date: 2006-12-01 3:04:42 AM
Comment:
hi
i am doing some thing like this when user click on + the an new template is loaded and when use click on that use button(submit) i have to remove that line with out refress can any one help me with this
Title: Super control...   
Name: zoestt
Date: 2006-11-30 4:29:47 PM
Comment:
This control..is wicked.. Thanks. You have done a great service to all who hate embedding a Datagrid in a Datalist.
Title: Mr   
Name: George
Date: 2006-11-16 7:12:02 PM
Comment:
Hi
I'm trying out the HirarGrid control and I think its great!
However I can't get the child table and [+] images to display.

I've used another datagrid to display childrows,its not breaking the code, just xs in the + images and when I click on where the images should be it dropdown slightly with nothing in the child table datagrid.

Please help!..someone
George
gmukwewa@yahoo.com
Title: To Pankaj   
Name: Denis Bauer
Date: 2006-10-31 3:10:28 PM
Comment:
Hi Pankaj,

first guess is that it's not an error but more a perf problem. Is the CPU busy? Would you be able to render the same amount of data with a regular DataGrid? Please contact me via email.

Denis
Title: Page Hangs   
Name: Pankaj Bansal
Date: 2006-10-30 11:27:52 AM
Comment:
I have succesfully implemented DBauer.Web.UI.WebControls.Hierargrid in my code and it is working fine.

The DataSet contains 5000 records and I am displaying 1000 records per page. When I tried to sort on a Column, it hangs or no repsonse.

It also doesn't give any error/exception. The process became endless most of the times.
Hoever,it works fine when I tried to use with less number of records per page.

It also works fine when I used with my local DB with 1000 records per page.

Can you suggest how to find out the error?

Best regards,
Pankaj Bansal
Title: Mr   
Name: Arun Kumar T
Date: 2006-10-12 12:42:46 AM
Comment:
Hello Sir
I am Arun Kumar from chennai INDIA. Saw your profle got impressed the way you reponse to the people queries. Sir, Basically my role defined as Senior Usability Engineer. But i have some problem in creating components, I do research on the product architecture and functional architecture before i start developing the prototype of the product UI. Is there any other stuff i should know in the field of UI or need to develop knowledge in the platorms or programming codes. Can i get any sample components related to UI similar like [Ajax or something]Please help me how to fulfil my role

Please Reply to my mail ID arunt@jbsoftindia.com

Thanking you. GOOD LUCK
Title: Mrs.   
Name: Geetha
Date: 2006-10-11 8:59:25 AM
Comment:
Hi,
I tried HierarGrid in my project.It worked fine.
Can U please explain me whether im can replace the the Grid's paging style out of the grid.

Please Help geethag@jbsoftindia.com
Title: @Nimesh   
Name: Denis Bauer
Date: 2006-10-09 10:34:35 AM
Comment:
Hi Nimesh,

for questions about the standard ASP.NET DataGrid please refer to the ASP.NET Forums at http://forums.asp.net.

Denis
Title: Datagird event   
Name: Nimesh patel
Date: 2006-10-09 9:31:38 AM
Comment:
hello sir i want to know that when i am putting dropdown list in datagrid how can i got the cahged event of this dropdown control event onchange i want to open textbox in another column if u can give me reply on
nim_00in@yahoo.co.in
Title: @Erika   
Name: Denis Bauer
Date: 2006-10-06 2:06:26 PM
Comment:
Hi Erika,

which of the samples are you referring to? Please write me an email and describe the problem you are facing.

Denis
Title: Paging the child hierargrid   
Name: Erika
Date: 2006-10-04 2:36:04 AM
Comment:
I was testing your nested hierargrid on a new project when I had a problem with the paging of the nested grid.
So I tried again your demo changing the Paging Size of the nested grid to 2 to prove the paging.
It didn't seem to work (the page index changed but the grid didn't show the second page of titles of the selected author).
Many thanks for your work: it is very very good and well explained.
So, I hope you can answer me soon.....
Title: Mrs.   
Name: Geetha
Date: 2006-09-25 2:42:37 AM
Comment:
I am trying out your control in my project.so is that enough to only add the HierarGridDLL to my project.

Thanks
Geetha
geethag@jbsoftindia.com
Title: HierarGrid Multi Field Edit   
Name: Mobie
Date: 2006-08-17 4:49:16 PM
Comment:
Denis,

I appreciate your response.

I’ve had a little trouble getting the fix code to work. Is it possible you could give me an example loop syntax? I’m a little confused about how it will handle the auto generated panel, etc ID’s and how to make it iterate through all the levels. Lastly, I’m not sure how and when to cast the result as a TextBox to retrieve the value from the template columns.

Mainpage.aspx (Contains HierarGrid1)
Level2.ascx (Contains HerarGrid2 HG1 and a template column field)
Level3.ascx (Contains a standard DataGrid DG1 and a template column field)

Control c=HierarGrid1.Items[i].Cells[1].FindControl("DCP").FindControl("Panel").FindControl("Panel_[PanelId]").FindControl("ChildTemplate_[PanelId]").FindControl("[InnerControlId]");

I would email you directly, but I still get an error about failed delivery over foreign mail servers.

Thanks for your time,

Mobie
Title: To Mobie   
Name: Denis Bauer
Date: 2006-08-16 7:20:55 AM
Comment:
Hi Mobie,

unfortunately, it is not as easy as I would like it to be. Please check out my blog post for the FindControl syntax:
http://www.denisbauer.com/weblog/NewHierarGridVersion16.aspx

HTH
Denis
Title: HierarGrid Multi Field Edit   
Name: Mobie
Date: 2006-08-11 4:52:13 PM
Comment:
First, great job on creating the HierarGrid--it has really been of great help.

I am trying to do a multi layer, datagrid edit.

I have 3 levels (3 tables) and 1 plus icon for each. I expand all on load and have the editable field setup as a template column/text field. My goal is to allow the user to update the parent and child fields on all 3 levels at the same time. (VS line by line.) Once the changes have been made, I have a button to "Commit All Changes."

I have no problems doing this on a single level datagrid. Now I'm just trying to find a way that I can loop through the child rows and save them to the database as I do with the parent.

Below is how I loop through the parent datagrid and store the results in a datatable.

DataTable dt = new DataTable("PMT");
dt.Columns.Add("EditMe");

foreach(DataGridItem dgi in dgDataTest.Items)
{
DataRow drw = dt.NewRow();
TextBox txt = (TextBox)dgi.FindControl("txtEditMeItemTemplate");
drw["EditMe"] = txt.Text.Trim();
dt.Rows.Add(drw);
}


Any ideas would be appreciated,

Thanks,

Mobie
Title: HierarGrid: A Hierarchical DataGrid that Displays Master-Detail Relationships   
Name: kiran
Date: 2006-08-02 1:54:10 AM
Comment:
sir, this is to good but i have problem on this statement
Dim dgi as DataGridItem = CType(Me.BindingContainer, DataGridItem)
Dim ds as DataSet = CType(dgi.DataItem, DataSet) '<- problem
DG1.DataSource = ds

i cant get data at dgi.DataItem is set to nothing allways
or
DataBinder.Eval(CType(Container, DataGridItem).DataItem, "au_lname")
this statement will not work correctly
please suggest me help realted to this

thanks ,
kiran
kiran.bhandare@rheal.com
Title: Is it Paging and Sorting, possible in nested approach.   
Name: Arun
Date: 2006-08-01 2:13:07 PM
Comment:
Hi,
Excellent control. was very helpfull with my work. Thank you very mcuh.
Have a question ? Paging doesnt seem to work when used in Nested mode, in the inner Hierargrids. When the i hit the page numbers, actually the control looses the state, i.e all the rows collapse. Any idea why this happens ?

you can reach me at mailarunv@yahoo.com

thanks
arunv
Title: MR   
Name: ravi
Date: 2006-07-20 8:19:50 AM
Comment:
I am getting an error namespace databinder not found(missing using directive or assembly).. when i am trying to insert data into datalist from database


private void DataList1_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e)
{
LinkButton lnkcat = (LinkButton)e.Item.FindControl("lnk");
lnkcat.Text = DataBinder.Eval(e.Item.DataItem,"category_name").ToString();
lnkcat.CommandName = DataBinder.Eval(e.Item.DataItem,"category_id").ToString();
lnkcat.Click += new EventHandler(lnkcat_Click);
}
Title: Showing Heading   
Name: Malebo
Date: 2006-07-13 10:23:27 AM
Comment:
Hi,

Is there really a way to add the Heading to the nested child. To appear only once, on the top. I've thought of every possible way but obviously i have got limited knowledge. Can u please help?
Title: Web Developer   
Name: Tarek mosaad
Date: 2006-07-08 10:43:53 AM
Comment:
Control is very good thanx
Title: To Zhen Yu   
Name: Denis Bauer
Date: 2006-06-29 10:45:22 AM
Comment:
Hi,

please make sure to set the "Build action" in the property window to Embedded resource for the JS files.

HTH
Denis
Title: "Value cannot be null. Parameter name: stream "   
Name: Zhen Yu
Date: 2006-06-29 10:29:11 AM
Comment:
Hi,

I have a custom class that inherits HierarGrid. I'm using bynary reference. But I get this error:

"Value cannot be null. Parameter name: stream "

OnPreRender when trying to extend this control


***************** MORE DETAIL ***************
[ArgumentNullException: Value cannot be null.
Parameter name: stream]
System.IO.StreamReader..ctor(Stream stream, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize) +126
System.IO.StreamReader..ctor(Stream stream) +101
DBauer.Web.UI.WebControls.HierarGrid.OnPreRender(EventArgs e) +255


Thanks
Title: Checkbox sample   
Name: Stephen
Date: 2006-06-22 5:54:08 AM
Comment:
Hi, can provide a full sample using checkbox in your grid, i cannot seems to get this working, im trying to get the values selected on the child table, please help

REgards,
Stephen
Title: KJ   
Name: Kashi
Date: 2006-06-15 5:46:47 AM
Comment:
when i try to run test application its raise EXCEPTION
"
The base class includes the field 'HG1', but its type (DBauer.Web.UI.WebControls.HierarGrid) is not compatible with the type of control (DBauer.Web.UI.WebControls.HierarGrid).
"
Title: it works now, wonderful   
Name: pishi
Date: 2006-06-01 2:16:05 PM
Comment:
I have a friend named Ahmad(he is software engineer in salt lake city), he told me to look at the demo source, I did and I could find my problem.
Million thanks to Denis and my dear friend Ahmad
Title: System.NullReferenceException: Object reference not set to an instance of an object.   
Name: pishi
Date: 2006-06-01 11:13:19 AM
Comment:
I added this to child page which is user control but I get null; or System.NullReferenceException: Object reference not set to an instance of an object.
please let me know what is the problem

private void Text(object sender, System.EventArgs e)
{
try
{
DataBinder.Eval(Container.DataItem,"AwardID");
}
catch (Exception ex)
{
Label1.Text = ex.Message;
}
}
Title: System.IO.FileNotFoundException:   
Name: Susi
Date: 2006-05-31 5:20:24 PM
Comment:
I've got the same error on file.ascx system.io.filenotfoundexception.
please help me
Title: system.io filenotfound exception   
Name: someone
Date: 2006-05-31 5:12:06 PM
Comment:
I've got System.io.filenotfoundexception error on the child template.
Title: To Naina   
Name: Denis Bauer
Date: 2006-05-30 9:24:11 AM
Comment:
Hi Naina,

did you check out the FAQ on my website: http://www.denisbauer.com/weblog/WhyDoesTheDataItemOfMyHierarGridContainADataSetInsteadOfADataRowViewOrViceVersa.aspx

If that doesn't help, please send me an email directly.
Denis
Title: datagrid as a child control   
Name: naina
Date: 2006-05-30 5:24:52 AM
Comment:
Hello,

DataSet ds = (DataSet) ((DataGridItem) this.BindingContainer).DataItem;
this doesnt work for me ....in the ascx.cs file.

Please respond..its urgent !

thnkx in advance !
Title: To Steve   
Name: Denis Bauer
Date: 2006-05-11 10:52:47 AM
Comment:
Hi Steve,

no that shouldn't be a problem. In this case it seems that the HierarGrid cannot load the JS file that is an embedded resource. Did you include the source code or are you using binary references? Please send me the response via email.

Denis
Title: Mr   
Name: Steve Bagnall
Date: 2006-05-11 10:39:15 AM
Comment:
hI,

I get a ...

"Value cannot be null. Parameter name: stream "

OnPreRender when trying to extend this control, is there some reason that you can't inherit from the HierarGrid control?

Cheers Steve


***************** MORE DETAIL ***************
[ArgumentNullException: Value cannot be null.
Parameter name: stream]
System.IO.StreamReader..ctor(Stream stream, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize) +126
System.IO.StreamReader..ctor(Stream stream) +101
DBauer.Web.UI.WebControls.HierarGrid.OnPreRender(EventArgs e) +255
Title: Help   
Name: Farrukh
Date: 2006-04-18 5:16:24 PM
Comment:
Sir i have designed a child template. It is a user control and i have dropped a datagrid over there and Binded it as stated above but it is not working.Child rows are not getting filled.The dataset in the user control is empty.Plz help as soon as possible.

farrukh_ms@hotmail.com
Regards
Title: Mr   
Name: Patrick
Date: 2006-04-16 3:49:07 PM
Comment:
This is an exceptional piece of work and you are to be commended for letting others benefit from your code! Just downloaded your latest version and it fixed a problem I was having with the previous version: 'Unable to load user control' when populating the second table. It worked fined on XP but failed on Win2000 Server. The new control solved the problem with no code changes required on my part. Thanks!!!!!
Title: Child Paging   
Name: Rafael
Date: 2006-03-29 3:13:14 PM
Comment:
I'm working with a 3 level hierargrid. The first grid is working just fine with the paging set TRUE. But i'm trying to do the same with the child grid and it's not working.
Have any ideas why is that happening?

Child code for paging:

void HGDtAjuste_PageIndexChanged(object source, DataGridPageChangedEventArgs e)
{
HGDtAjuste.CurrentPageIndex = e.NewPageIndex;
Page.DataBind();
HGDtAjuste.RowExpanded.CollapseAll();
}
Title: Using HierarGrid without the DLL   
Name: Satyajit
Date: 2006-03-21 7:37:25 AM
Comment:
Hey Denis...First of all let me congratulate you for a great job. HierarGrid makes life a lot easier.
I have got a query. I have sucssefully used the HierarGrid DLL to display information in my project. However I want to add the source code inside my project rather than referring to the dll. Can I do it ? What all things I will have to keep in my mind if I copy all the source code inside my project ? Please suggest.
If anyone has done it then please share the information with me.
Congrats again for a nice job.
Thanks in anticipation !
Title: Access child rows   
Name: Walaa
Date: 2006-03-19 7:18:50 AM
Comment:
Hi Denis,
Nice work indeed.

How can I programatically access data in the child rows from the DataGrid page.

Normally I'd do the following to access items in a normal datagrid row:

foreach(DataGridItem dgItem in grdResult.Items)
{
...dgItem.Cells[3].Text // to be read or modified
}
Title: Great Work   
Name: Ajay Kumar
Date: 2006-03-15 7:50:56 AM
Comment:
Hai,
Its Really Great Control, its like Dream come true

Thanks a Lot
Title: The type or namespace name 'HierarGridERROR: TemplateSelectionEventArgs' could not be found   
Name: Kristen Hazard
Date: 2006-03-02 1:59:56 PM
Comment:
After implementing the TemplateSelection event I got the following error when I tried to build my project.

The type or namespace name HierarGridTemplateSelectionEventArgs' could not be found (are you missing a using directive or an assembly reference?)

I was able to fix by adding the following line to my C# file:
using DBauer.Web.UI.WebControls;
Title: Mr.   
Name: kalyan
Date: 2006-03-01 12:36:53 AM
Comment:
i want code for master details with comboo and check edit at run time
useing sqlserver and vb.net
Title: To Manoj   
Name: Denis Bauer
Date: 2006-02-15 9:55:32 AM
Comment:
Hi Manoj,

all available samples are on my website. Please understand that I cannot create extra samples for individual use cases.

Denis
Title: Hierarchical Datagrid in asp.net   
Name: Manoj
Date: 2006-02-13 12:54:44 AM
Comment:
hello sir,
Can u help me out.I am trying to build a hierarchical web grid code behind vb.net using Nhibernate.I have successfully done the relationship but the problem is to display child grid in 2nd row i.e if the first row is parent.now it is showing child and parent in same row.Please help me with the code or example
Title: edit HierarGrid   
Name: Carlos Malagón
Date: 2006-02-12 12:30:36 AM
Comment:
Hi, i'm try to use the HierarGrid to edit rows, but my HierarGrid has many levels, when i try to edit i lost the edit row, i think that the HierarGrid lost the row upper.

What can i do?....

thank you
Title: Mr   
Name: Nethaji R
Date: 2006-02-10 1:57:10 AM
Comment:
Hi
Denis i need Nested HierarGrid which should dislay nested comments
Title: Parent/Child Column Alignment   
Name: Bob McCreedy
Date: 2006-02-07 4:12:21 PM
Comment:
Denis,

My hierargrid is set up so that the last 8 columns of both the parent and child grids contain the exact same set of data. I have been trying to get these columns to stay perfectly aligned when the child grid is displayed (i.e. parent and child column widths are the same). Any idea how that can be accomplished? Thanks.
Title: Re:To Maureen   
Name: Maureen
Date: 2006-02-05 9:10:52 PM
Comment:
Got it. Thank you so much for the help! =)


Regards,

Maureen
Title: To Maureen   
Name: Denis Bauer
Date: 2006-02-03 5:31:29 AM
Comment:
Hi Maureen,

both question should be addressed in the HierarGridDemo. Please take a look at the NestedHierarGridDemo.aspx.cs, line 100: HG1.RowExpanded.CollapseAll();

HTH
Denis
Title: Expand/Collapse all   
Name: Maureen
Date: 2006-02-02 9:32:53 PM
Comment:
...Oh another thing, currently, does the Hierargrid have a capability for a Collapse all function?

Thanks again.

Maureen.
Title: Paging   
Name: Maureen
Date: 2006-02-02 6:26:54 AM
Comment:
Hello Denis,

It's me again. The Hierargrid on my application is working really well now. I just noticed something unusual.

If for example, I expanded the first row on the first page of the grid and then I go to the next page of the grid, I noticed that the first row on the 2nd page is also already expanded when it is loaded. Same as with the first rows of the other pages. I have implemented paging for the grid and I have set AllowCustomPaging to false.

Any idea on how to address this prob?

Thanks very much in advanced.


Maureen
Title: To Justin   
Name: Denis Bauer
Date: 2006-02-01 5:50:10 AM
Comment:
Hi Justin,

thanks for helping out. Maybe I should setup a forum for HierarGrid questions. :)

I'll check your fix and include it in the next version.
Denis
Title: RE:Error on PostBack   
Name: Bob
Date: 2006-01-31 3:00:20 PM
Comment:
Justin,

Last question (I think) - in order to recompile, do I have to add all of the existing files in HierarGrid to a new project and then build? Or is there another way to recompile the dll by itself? Thanks again.

Bob
Title: @Bob   
Name: Justin
Date: 2006-01-31 2:35:28 PM
Comment:
Bob,
Yes you will need to recompile the .dll and make sure your newly compiled dll is in the project you are having the issue with.

~Justin
Title: RE:Error on PostBack   
Name: Bob McCreedy
Date: 2006-01-31 2:30:22 PM
Comment:
Justin,

I tried replacing line 154 with your sugggestion and I still get the error. Do I have to recompile the dll for the hierargrid? I also tried "swapping" the two lines you listed and had no luck either. Any additional guidance? I'm know I'm making this harder than it needs to be. Thanks.

Bob
Title: Error on PostBack   
Name: Justin
Date: 2006-01-31 2:04:43 PM
Comment:
In DynamicControlsPlaceholder.cs line 154.

string typeNameGarbage = subdir.ToLower().Replace("/", "_").Replace(".", "_") + "_";

If your subdir is root it makes typeNameGarbage = "_" and then 2 lines later replaces all _ with string.Empty and thus removes the chance for the period to get put back in on the next line.

You can swap these two lines (as long as you don't have a dir named ascx)
ucFilename = ucFilename.Replace(typeNameGarbage, string.Empty);
ucFilename = ucFilename.Replace("_ascx", ".ascx");

Or on line 154 replace the _'s with * like

string typeNameGarbage = subdir.ToLower().Replace("/", "*").Replace(".", "*") + "*";
That resolved the issue for me.
Title: To Bob   
Name: Denis Bauer
Date: 2006-01-31 1:42:26 PM
Comment:
Hi Bob,

please send to programming at denisbauer .de
Denis
Title: RE:Error on PostBack   
Name: Bob McCreedy
Date: 2006-01-31 11:52:05 AM
Comment:
Denis,

The email address info@denisbauer.com comes back as rejected for me for some reason (something about foreign mail servers). Anyway, I am running my page using the 1.1 framework, so I don't think it is limited to ASP.NET 2.0. If there is anything I can help test, please let me know. Thanks.
Title: To Bob   
Name: Denis Bauer
Date: 2006-01-31 11:13:13 AM
Comment:
There still seems to be a problem with ASP.NET 2.0 which I haven't found yet. Please contact me via email so we can work on this issue.

Denis
Title: Error on PostBack   
Name: Bob McCreedy
Date: 2006-01-31 10:47:22 AM
Comment:
\
\
\
\
Title: Great web Control   
Name: Roy MacTavish
Date: 2006-01-26 11:00:08 AM
Comment:
Good day,

I have been programming with ASP.Net web apps for about a month now. So being the rookie that I am, it took about 3 days to get the HierarGrid to work. But now that I have it working, I must say, Good Job to you Mr. Bauer.
Thank you!!

Roy MacTavish
New .NET Programmer
Title: Could not load UserControl   
Name: Subandi Wahyudi (subandi@capcx.com)
Date: 2006-01-24 3:28:13 AM
Comment:
\
\
\
\
\
Title: How to assign edit textbox field ?   
Name: Kenster
Date: 2006-01-23 6:28:57 AM
Comment:
Hi Denis Bauer,
Yr control works great..thumb up for it. However right now i trying to incorporate editing features into the control and is facing some errors.
I code as :

'To get first field in textbox to assign it to temp
dim temp as textbox = e.item.cells(0).controls(0)

However i got the error msg...Hope u can help me..Thanks again bro.

Specified argument was out of the range of valid values. Parameter name: index
Title: On + click need to Add Child DataGrid   
Name: Nitin
Date: 2006-01-19 12:11:58 PM
Comment:
First of I thanks to you, this control help me lot.

As now all three levels are added at Page Load time. I have needed some Advance functionality. I want to add child Grid at + click and same for the third level. It can possible with this control.

Please provide me best solution ASAP.
Thanks
Title: To Manish   
Name: Denis Bauer
Date: 2006-01-05 8:23:20 AM
Comment:
Hi Manish,

the control source is available on my homepage and you shouldn't need to change anything for the basic scenarios that are described in my sample apps.

HTH
Denis
Title: some refinement required   
Name: manish punwani
Date: 2006-01-02 7:12:33 AM
Comment:
The Control is really excelent!!!!!!!
But in user control instead of label i wanted that particular record in a datagrid. the data appears in the grid but not of respective record. I suppose some coding needs to be done in the webcontrol. but as the source is not available thats why it seems not possible.
pls revert manish.punwani@e-pspl.com;mpunwani@gmail.com
rgds
manish
Title: To Sanjay   
Name: Denis Bauer
Date: 2005-12-29 1:00:33 PM
Comment:
Hi Sanjay,

please take a look at my blog to find out how to debug "my child records don't display" issues:
http://www.denisbauer.com/weblog/TroubleshootingHierarGridPlusminusIconProblems.aspx

Thanks
Denis
Title: Mr.   
Name: sanjay
Date: 2005-12-27 1:19:13 AM
Comment:
i have used heirargrid i works fine and very usefull in many application
still i found some problem
i made the relation as shown Dim cn As New SqlConnection("uid=sa;pwd=sa;initial catalog=EmployeeDB;data source=comp4")
Dim s, s1 As String
s = "Empview"
Dim ds As New DataSet
Dim com As New SqlCommand
com.Connection = cn
com.CommandText = s
com.CommandType = CommandType.StoredProcedure

cn.Open()
Dim da As New SqlDataAdapter(com)
da.Fill(ds)
cn.Close()
ds.Tables(0).TableName = "Employee"
ds.Tables(1).TableName = "employeename"
Dim dc1 As DataColumn
Dim dc2 As DataColumn
dc1 = ds.Tables(0).Columns(0)
dc2 = ds.Tables(1).Columns(0)
Dim dr As New DataRelation("empname", dc1, dc2, True)
ds.Relations.Add(dr)
HG1.DataSource = ds
HG1.DataMember = "employee"
HG1.DataBind()
HG1.RowExpanded(0) = True



i made another user control where i am using datagrid where i am only just provided the same code u have given

but in childrow the data doesen't displays.ie it is not able to get the data he is getting correct table

how should i get the data plz help me to out from this problem
Title: Re:To Maureen   
Name: Maureen
Date: 2005-12-20 10:15:47 PM
Comment:
Hello Denis,

I see. No prob. I'll just think of another implementation.


Thanks very much,

Maureen
Title: To Denis   
Name: HideColumn question
Date: 2005-12-20 6:46:48 PM
Comment:
Thanks for the quick reply and the link to the FAQ. That's excactly what I wanted and I was able to rename/hide columns after reading your FAQ.
Thanks again,
Ravi
Title: To Ravi   
Name: Denis Bauer
Date: 2005-12-20 12:27:23 PM
Comment:
Hi Ravi,

please check out http://www.denisbauer.com/weblog/DefiningTheColumnsInTheHierarGrid.aspx

I've posted the FAQ in my blog under the following category
http://www.denisbauer.com/weblog/CategoryView,category,Software,ASP.NET,HierarGrid.aspx

HTH
Denis
Thanks
Denis
Title: How to hide a column in the Parent table   
Name: Ravi
Date: 2005-12-20 11:50:51 AM
Comment:
Hi Denis,
Thanks a lot for the cool grid.
I was wondering if there is a way to hide a column from the Parent table. For example, in your demo, TitleID is visible, is there a way to hide it?.
Thanks
Ravi
Title: To Maureen   
Name: Denis Bauer
Date: 2005-12-20 7:11:22 AM
Comment:
Hi Maureen,

there is no built in functionality in the HierarGrid to do that. Maybe you can achieve what you want with some JavaScript and getElementById but I don't have a sample for that
Sorry,
Denis
Title: Re: Question on Hierargrid   
Name: Maureen
Date: 2005-12-18 10:23:42 PM
Comment:
Hi Denis,

Thanks for the reply.
My application is working great now.

Just one more question. I've got this requirement to gray out the checkbox on my parent grid when one or more checkboxes from the child grid is unchecked. Any suggestions on how I can access or call the checkbox from the parent grid when I'm in the child grid?

Thanks a lot. Have a nice day.


Maureen
Title: To Maureen   
Name: Denis Bauer
Date: 2005-12-13 11:18:39 AM
Comment:
Hi Maureen,

please take a look at the answers I gave to Neeraj and JK. Sometimes IE doesn't seem to be able to handle the amount of data that is rendered. My recommendation is to split up the data with paging or filtering.

HTH
Denis
Title: Question on Hierargrid   
Name: Maureen
Date: 2005-12-10 5:29:07 AM
Comment:
Hello Denis,

This is really a great control, it helped me a lot with the current application that I'm working on. Thanks so much! =)

Just one thing though, when I already used a large amount of data and clicked on the "+" icon, an explorer error occured (iexplorer.exe - Application error).

I would greatly appreciate any inputs or ideas on how this error can be resolved.

Thanks again.

Regards,

Maureen
Title: HieraGrid and ASP.NET 2.0   
Name: tgc
Date: 2005-11-24 1:28:44 AM
Comment:
Has anyone used the HieraGrid with ASP.NET 2.0? I need a control just like HieraGrid for a project I am working on, but i'm developing with VS.NET 2005...or is there built in support in .NET Framework v2.0 for this?
Title: Sorting & field Names   
Name: Wazza
Date: 2005-11-22 8:11:35 PM
Comment:
Hi and congratulations on Hiergrid, it is a wonderfully useful tool.

I have 2 issues i haven't been able to solve yet, if anyone can help, it would be greatly appreciated.

1. While i've implemented sorting on the Hiergrid, i cannot implement sorting on the nested grid - has anyone seen this done ?
2. I can't get the Hiergrid to work when the pages aren't in the root folder of the website - a minor inconvenience.

Any info would be great.
Title: Winforms Equivalent   
Name: Henno
Date: 2005-10-25 6:23:15 AM
Comment:
Hi,

Do any of you know if there's a Winforms equivalent of this control.

Thanks
Title: @Raymond   
Name: Denis Bauer
Date: 2005-10-25 5:55:19 AM
Comment:
True, I missed that. Please make sure that your event handler contains the "handles" clause:
Private Sub HG1_TemplateSelection(ByVal sender As Object,
ByVal e As HierarGridTemplateSelectionEventArgs)
Handles HG1.TemplateSelection

If it still doesn't work, please send me your vb file via mail.
Denis
Title: Wire TemplateSelection event   
Name: Raymond
Date: 2005-10-25 5:19:18 AM
Comment:
Thanks for your response Denis.

However, according to the artile the code you specified is only required if the script is written in C#. I am actually trying to implement this functionality using VB.NET...
Title: @Raymond   
Name: DenisBauer
Date: 2005-10-24 3:33:40 AM
Comment:
Hi Raymond,

please take a look at section 3.7 that explains how to wire up the TemplateSelection event:
this.HG1.TemplateSelection +=
new HierarGridTemplateSelectionEventHandler(this.HG1_TemplateSelection);

Denis
Title: Please use the event "TemplateSelection" to specify which template to load for a child table/row   
Name: Raymond
Date: 2005-10-23 8:41:26 AM
Comment:
I am trying to do this using Web Matrix. Basically i have a Main.aspx form and a template called Authors.ascx

The error that i'm getting is:
System.ComponentModel.WarningException: Please use the event "TemplateSelection" to specify which template to load for a child table/row

Line 56: HG1.DataSource = ds
Line 57: HG1.DataMember = "Titles"
Line 58: HG1.DataBind()


The code i have for the Main.aspx page is:

Sub Page_Load(sender as Object, e as EventArgs)
Dim sqlConnection As System.Data.IDbConnection = New System.Data.SqlClient.SqlConnection()
Dim sqlCommand As System.Data.IDbCommand = New System.Data.SqlClient.SqlCommand()

sqlConnection.ConnectionString = "server='(local)'; trusted_connection=true; database='pubs'"

sqlCommand.CommandText = "[TestData]"
sqlCommand.CommandType = System.Data.CommandType.StoredProcedure
sqlCommand.Connection = sqlConnection
Dim ds As System.Data.DataSet = New System.Data.DataSet()

sqlConnection.Open()
Dim adap As System.Data.IDbDataAdapter = New System.Data.SqlClient.SqlDataAdapter(sqlCommand)

adap.Fill(ds)
sqlConnection.Close()

ds.Tables(0).TableName = "Titles"
ds.Tables(1).TableName = "Authors"
ds.Tables(2).TableName = "Sales"
'============
Dim dc1 As System.Data.DataColumn
Dim dc2 As System.Data.DataColumn
'Relation Title => Author on Title_ID column
dc1 = ds.Tables(0).Columns("title_id")
dc2 = ds.Tables(1).Columns("title_id")
Dim dr As System.Data.DataRelation = New System.Data.DataRelation("Title_Author", dc1, dc2, False)
ds.Relations.Add(dr)

'Relation Title => Sales
dc1 = ds.Tables(0).Columns("title_id")
dc2 = ds.Tables(2).Columns("title_id")
dr = New System.Data.DataRelation("Title_Sales", dc1, dc2, False)
ds.Relations.Add(dr)

'===============

HG1.DataSource = ds
HG1.DataMember = "Titles"
HG1.DataBind()

End Sub

P
Title: @George   
Name: Denis Bauer
Date: 2005-09-27 4:06:37 PM
Comment:
Hi George,

to loop over the Checkboxes take a look at the following blog post: http://www.denisbauer.com/weblog/NewHierarGridVersion16.aspx

The last few lines show you some sample code.

Denis
Title: @Marcello   
Name: Denis Bauer
Date: 2005-09-27 4:02:47 PM
Comment:
Hi Marcello,

make sure that TemplateDataMode is set to SingleRow are change the child template appropriately. For further explanation take a look at the HGDemo on my homepage.

Denis
Title: I've got a little issue   
Name: Marcello (marcello.piraino@nc3a.nato.int)
Date: 2005-09-27 12:01:38 PM
Comment:
Does anybody know what the follow error mean?

DataBinder.Eval: 'System.Data.DataSet' does not allow indexed access.
Title: Great   
Name: Yose R
Date: 2005-09-27 3:33:11 AM
Comment:
Great article..... I've just finished ASP application from my client with this HierGrid. Great work Dennis
Title: Checkbox   
Name: George
Date: 2005-09-27 2:35:59 AM
Comment:
Dennis,

Hey, this control just made my life whole lot easier. Just one question. My parent grid contains a child grid with a template column containing a check box. How would I itterate through all child grids to get a collection of selected rows?
Title: Great Control, only if...   
Name: Marcello (marcello.piraino@nc3a.nato.int)
Date: 2005-09-23 8:08:42 AM
Comment:
Denis,
what you've done is just great; however, following the instruction published in the article you wrote with PaoloI was able to get nothing more than a grid which displays an empty right column (no plus sign) besides the others. What have I done wrong?
Title: Mr.   
Name: Moises Florez
Date: 2005-09-21 1:25:49 PM
Comment:
Hello Denis,

Let me start by thanking you for such a user friendly control. I would like to control the width of the HierarColumn. I have used the HierarColumn tags as you describe in your tutorial. However, the column does not show when using this method. The tag with no additional configuration does not work. Can you point me in the right direction? Thank you in advance for your help.

Cheers,

Moises Florez
mflorez@willkie.com
Title: getting error when trying to get an Event Handle from the User Control into the main   
Name: Vinay Kr. Chowdhary
Date: 2005-08-29 2:13:26 AM
Comment:
Thnaks denis ,I found this article very much usefull for all developers using datagrid. can u send me the solution for this funny error,
The type or namespace name 'HierarGridTemplateSelectionEventHandler' could not be found (are you missing a using directive or an assembly reference?)
my Mail: vinay.chowdhary@d-channel.com, vinay_chowdhary@yahoo.com
Thanks in Advance
Title: @Mezzo   
Name: Denis Bauer
Date: 2005-08-23 5:03:54 AM
Comment:
No, this is a WebControl. The WinForms DataGrid supports relations out of the box. Do a quick MSNSearch and you'll get a ton of results.

Denis
Title: it is possible in window form?   
Name: Mezzo
Date: 2005-08-23 3:35:51 AM
Comment:
This really cool and I hope it can use at window form.
Do you have any ideas about it?
Title: @Suneet   
Name: Denis Bauer
Date: 2005-08-08 8:19:09 AM
Comment:
HG.RowExpanded.ExpandAll();
Title: Expanded rows by default on pageload...   
Name: Suneet
Date: 2005-08-08 12:58:07 AM
Comment:
Please tell me how to show expanded rows in grid on pageload so that user sees all rows as expanded.

Thanks.
Title: Hiding Columns/Naming Columns of Child Grid   
Name: Eddie
Date: 2005-08-04 5:53:09 PM
Comment:
Is there a way to hide certain columns on the parent grid? I've tried settig the property .Columns(index).Visible to False but it seems the HierarGrid thinks it is only a one column table (i.e., any index value greater than zero returns an out of range error).

Is there a way to add column names to the child grid?
Title: @Ngo Quan   
Name: Denis Bauer
Date: 2005-07-18 3:29:15 PM
Comment:
Hi Quan (this is your first name, right)

ArrayList as a data source for the HierarGrid are not possible by default because you cannot outline a hierarchy.

If you have your custom business object that e.g. have a children property, you'd need to customize the HierarGrid

Denis
Title: @JK   
Name: Denis Bauer
Date: 2005-07-18 3:25:51 PM
Comment:
Hi JK,

I've answer the question earlier. Please search for "Neeraj" to find my answer above.

Don't know what was wrong with email - must have been an intermittent problem.

Denis
Title: Does it work with DataSource as Collection   
Name: Ngo Quan
Date: 2005-07-17 11:59:10 PM
Comment:
Is HierarGrid work done with Datasource as Colllection?
Title: HierarGrid becomes slow when used with a large DataSource   
Name: JK
Date: 2005-07-15 12:30:46 PM
Comment:
Hi Denis,

I have recently been trying out your HierarGrid. It's a great control and thanks a lot!

I have modified the NestedHierarGridDemo to display a dataset with 3 DataTables and 2 DataRelations of data queried from a stored procedure. Everything works fine except when record number of the tables get large (in the order of thousands of records) , it tends to take a long time for the grid to display itself on the browser. A check on the file size of the rendered aspx page also revealed that it's huge (more than 10MB).

Is there any way that the HierarGrid can dynamically populate the data on its child grids on click of the expand/collapse button instead of dumping the data into the html all at once on page load?

Thanks

P.S. I tried your email from your web site, it returned a failed delivery message.
Title: @Neeraj   
Name: Denis Bauer
Date: 2005-07-15 9:59:41 AM
Comment:
Thanks, Neeraj, for the nice feedback. Glad that you like the Hierargrid.
Title: Mr   
Name: Neeraj Gupta
Date: 2005-07-14 8:54:32 AM
Comment:
Hi Denis,

You deserve a pat on ur back!
Excellent control with awesome doumentaion to support it!!

I didn't encounter a single issue while implementing it in my own site.

Thanks a lot!
Neeraj Gupta
gupta.neeraj@india.birlasoft.com
N.gupta@ge.com
Title: @Isaac   
Name: Denis Bauer
Date: 2005-07-12 5:38:43 PM
Comment:
Hi Isaac,
sounds pretty good but what exactly is your question :)
Are you considering to use the HierarGrid for that? Feel free to email me (address is on my homepage)

Denis
Title: Project manager   
Name: isaac mihaeli
Date: 2005-07-12 3:16:05 PM
Comment:
Dear Mr. Bauer:


I am working on a project that has several datagrids with Master/Detail content. In one datagrid I have a select button where I click and want to expend several rows, then click again to collapse the records.

Sincerely,
Title: Ms   
Name: Satish
Date: 2005-06-29 9:23:51 AM
Comment:
I am using the grid for my project.
I have a Stored Procedure which returns two tables.I am binding the grid to the dataset.
I am didplaying the record in the first level.
When i click +/- its not opening the child grid.ANy help will be appreciated.
Title: unwanted data comes   
Name: kautilya
Date: 2005-06-21 5:15:06 AM
Comment:
hi guys,

previously i was not getting the results butthen after on the next day i got it. i wnat to use this grid in forum application but the problem is that it is showing the ids also that is what i don't want to show i want to show category name i dont know how to do that i m trying since last 4 days but i m not able if any one has any idea please mail me on my mail address

thanks
Title: @Carlos   
Name: Denis Bauer
Date: 2005-06-13 6:46:32 AM
Comment:
Hi Carlos,

that should be working. Can you send me a repro via email.

Denis
Title: ItemDataBound   
Name: Carlos Malagón
Date: 2005-06-10 4:58:47 PM
Comment:
Hi, in the template control "template.ascx" i want to control the ItemDataBound event, i have the follow instruction "this.grdDetalle.ItemDataBound+=new DataGridItemEventHandler(grdDetalle_ItemDataBound);" in the InitializeComponent procedure. But doesn't do anything.

What can i do?

Thanks you,

Carlos Malagón
Title: Empty DataSet Returned   
Name: Puneet
Date: 2005-06-09 11:05:11 PM
Comment:
Hi Kautilya,

The code snippet has to be placed inside the Page_DataBinding event (not the Page_Load event).
Title: @Roy   
Name: Denis Bauer
Date: 2005-06-08 1:39:04 PM
Comment:
Hi Roy,
you can insert the HierarColumn with the regular ASP.NET syntax:

{dbwc:HierarGrid ...}
{Columns}
{dbwc:HierarColumn /}
{/Columns}
{/dbwc:HierarGrid}

HTH
Denis

P.S.:Sorry about the poor formatting. Angle brackets are not permitted in comments. Replace { with &lt;
Title: @kautilya   
Name: Denis Bauer
Date: 2005-06-08 1:28:42 PM
Comment:
Hi Kautilya,

the code snippet you pasted is exactly the code from my sample. So the problem is definitely not there. Please send me some futher info via mail.
Denis
Title: HeirarColumn at Design Time   
Name: Roy
Date: 2005-06-08 8:12:33 AM
Comment:
Hi, You mention in the article that it is possible to put the HeirarColumn in to the grid control at design time (even though you add it if its not there...nice!).

Can you give me a sample of the HTML required to do this ?

Thanks
Title: quite good   
Name: kautilya
Date: 2005-06-06 7:20:33 AM
Comment:
ur control is quite good buti am not able to get access to binidingcontainer property and container property. i tried for both u specified for datagrid and textbox in ur example but for both i have problem because of bindingcontainer and container property. in datagrid ascx file i am get my dataitem empty and my dataset empty please show me solution quick .
my code snippets as follows

for authors.ascx
----------------

Dim dgi As DataGridItem = CType(Me.BindingContainer, DataGridItem)
Dim ds As DataSet = CType(dgi.DataItem, DataSet)
DG1.DataSource = ds
DG1.DataMember = "Authors"
DG1.DataBind()


for sales.ascx
---------------

Dim dgi As DataGridItem = CType(Me.BindingContainer, DataGridItem)
Dim ds As DataSet = CType(dgi.DataItem, DataSet)
If (Not (TypeOf dgi.DataItem Is DataSet)) Then
Throw New ArgumentException("Please change the TemplateDataMode attribute to 'Table' in the HierarGrid declaration")
End If

DG1.DataSource = ds
DG1.DataMember = "Authors"
DG1.DataBind()

my mail address is darshu_net@rdiffmail.com
thanks
Title: Mozilla incompatibility   
Name: @Puneet
Date: 2005-05-31 12:40:20 PM
Comment:
Hi Puneet,
unfortunately, that is a known issue my control has with Mozilla-based browsers. I don't have a work-around yet. If anyone goes ahead and fixes my JS file, I'd love to know how.

Thanks
Denis
Title: Mr.   
Name: Puneet
Date: 2005-05-31 1:57:34 AM
Comment:
Hey Denis,

Thanks for such a awesome control.

The problem that i am experiencing is whenever there is any postback (through paging or editing) from within the nested grid, all the nodes collapses in Mozilla (however it works fine in IE). I also experience the same problem while running your nested paging, sorting demo in Mozilla.

I had a look at the Javascript file Startup.js. I reckon u using that script on postbacks in order to maintain the state of +/- signs.

Any help will be appreciated.
Title: SQL Error: Invalid column name 'title_id'   
Name: Clinton Gallagher
Date: 2005-05-24 11:34:54 PM
Comment:
I created the views and ran them but the TestData stored procedure throws the exception as noted.
Title: Questions via EMail   
Name: Denis Bauer
Date: 2005-05-17 8:36:49 AM
Comment:
Meera and Carllos:

Please send me your questions and feedback via email. Address can be found on my homepage or use the "Feedback" link at the top of the page.

Thanks
Denis
Title: MENY ROWS   
Name: Carlos Malagón
Date: 2005-05-16 6:05:20 PM
Comment:
I try to show a HierarDataGrid with two levels but the inner level have many rows, why the IE show slowly the data?.
Title: NestedHierarGrid   
Name: Meera Tripathi
Date: 2005-05-14 7:25:51 AM
Comment:
I have the requirement of drilling down of database till six level using Parent Child relationShip and I saw this NestedHierarGrid , Impressed but will it suffice my requirement?????

I am not able to use this more than 3 level as per shown in your sample . Could you suggest me How Could I implement your HierarGrid till six level ??? I urgently needing this...

Is there any other way to do so..Pls. Suggest...
Title: To Steve   
Name: Denis Bauer
Date: 2005-05-11 10:42:33 AM
Comment:
Please send any question to me directly via email.
Regarding you question: You can use the ItemDataBound event like you described and then access the child rows by casting your DataItem to DataRowView and calling GetChildRows on the corresponding row.

HTH
Denis
Title: ItemDataBound on the children   
Name: Steve
Date: 2005-05-09 4:20:16 PM
Comment:
Allow me to join the preceding thankx for your contribution both for the original control as well as your continued support here in this forum.

I'm looking to control the row color of child row based on a value of one of the children's databinder fields. In a conventional grid I'd add code to a myGrid_ItemDataBound handler. But attempting to reference a field in the child 'grid' is causing problems because that field name isn't found in the parent.

any thoughts?
Title: To venkat   
Name: Denis Bauer
Date: 2005-05-06 11:04:51 AM
Comment:
Did you set TemplateDataMode to Table as described in chapter 3.9? If that's not the problem please follow up with me via email. The address is on my homepage.
Denis
Title: unable to get the user Control DataGrid   
Name: venkat reddy
Date: 2005-05-06 8:22:42 AM
Comment:
Respected Sir,
iam very happy to use this Hierarchiacl DataGrid, when i Bind Data to DataGrid But One Exception is Coming.
i have written one stored procedure in this stored procedure i have wriiten two Queries ,using this one iam binding the data to DataGrid,when i click "+" sign "Specified cast is not valid "exception" is coming iam unable to get the Second DataGrid,,what is the Problem?How Can i Solve This Exceptin Please help me.

Regards
venkat Reddy
Title: Collapsing Child Rows - FollowUp   
Name: JPuchyr
Date: 2005-04-28 6:24:06 PM
Comment:
Thanks Denis - that's what I was afraid of ;o)

if anyone's interested, adding this to the top of the HierarGrid_toggleRow function seems to work:
var parentTable = GetParentElementByTagName(sender, 'TABLE');
var expandedID = parentTable.getAttribute('ExpandedClientIDsName');
var expandedRowsList = document.getElementsByName(expandedID)[0].value;
var expandedRows = expandedRowsList.split(', ');
var expandedRow = document.getElementById(expandedRows[expandedRows.length-1]);

if((expandedRow!=null) && (expandedRow.id!=sender.id)) {
HierarGrid_toggleRow(expandedRow);
}


it does require an update to ChangeRowState which appears to have a memory leak.
the lines:
else if(state == 0)
rowStates = rowStates.replace(sender.id, "");

should be changed to:
else if(state == 0)
rowStates = rowStates.replace(", " + sender.id, "");

or you leave behind the commas.
Title: To JPuchyr   
Name: Denis Bauer
Date: 2005-04-28 12:01:26 PM
Comment:
Hi,

you'd have to change the javascript code because no server-side events fire when you click the +/- image.

Let me know, if that works

Cheers
Denis
Title: Collapsing Child Rows   
Name: JPuchyr
Date: 2005-04-26 7:38:32 PM
Comment:
Firstly, awesome control. I think I use it on almost every page I build ;o) Thanks Denis.

Question: How do I collapse all other child rows when the +/- image is clicked?

I can initiate a DBauer.Web.UI.WebControls.RowStates.CollapseAll() on the grids ItemCommand event, but that does not seem to fire when clicking on the +/-.

Thanks
Title: To Neeraj   
Name: Denis Bauer
Date: 2005-04-21 5:36:50 AM
Comment:
Hi Neraj,

that's the basic design principle of the HierarGrid. All data is rendered to the client and expanding/collapsing is done completely on the client side without the need for postbacks.

If your structure is more complicated than that it could be rendered at once, the HierarGrid might not be the best choice for your scenario. Of course, there are options to work around this by limiting the data that needs to be rendered like e.g. paging, filtering etc.

I received some emails from other people who thought about enhancing the HierarGrid with a delay-loading mechanism but I don't have a complete implementation yet and currently I don't have the time to implement it.

Cheers
Denis
Title: To Denis   
Name: Neeraj
Date: 2005-04-19 7:09:44 AM
Comment:
I found your Grid very useful. It is really great.

But I do have a bit different requirement. I need to bind the inner grid( in case of nested grid ) on click of the Plus Image, as the amount of data is too much. The inner grid can have about 2000 records, so it is not feasible to get all the data in one shot.

Thanks,
Neeraj
Title: To Iqbal   
Name: Denis Bauer
Date: 2005-04-18 1:47:43 PM
Comment:
Regarding the SNK issue please take a look at http://www.denisbauer.com/weblog/CryptographicFailureWhenRecompilingTheHierarGridDCPFileDisassemblerEtc.aspx

My newest demo show paging in the child grid:
http://www.denisbauer.com/weblog/UpdatedEditableHierarGridDemo.aspx

HTH
Denis
Title: @Sweetha   
Name: Denis Bauer
Date: 2005-04-08 5:28:57 PM
Comment:
Sweetha,

as the exception says, please use the TemplateSelection event to define the child template that needs to be loaded. That is explained in the section 3.7 in the article above and is included in every HierarGridDemo on my homepage.

Cheers
Denis
Title: Hierargrid   
Name: sweetha
Date: 2005-04-06 11:50:10 AM
Comment:
I get the following message when I try to bind to the grid:

Please use the event "TemplateSelection" to specify which template to load for a child table/row
Description: An unhandled exception occurred during the execution of the current web request. Please
review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ComponentModel.WarningException: Please use the event "TemplateSelection"
to specify which template to load for a child table/row

Source Error:


Line 39: HG1.DataSource = ds;
Line 40: HG1.DataMember = "Running";
Line 41: HG1.DataBind();
Line 42: }
Line 43:
Title: @Sankar   
Name: Denis Bauer
Date: 2005-03-23 11:38:17 AM
Comment:
Please take a close look at the NestedHierarGridDemo on my homepage and send all further questions to me via email.
Title: Nexted HierarGrid   
Name: Sankar
Date: 2005-03-23 9:34:02 AM
Comment:
Hello,
1. I set HierarGrid.TemplateDataMode=Table in mail ASPX page. before databind. I am getting this error
"DataBinder.Eval: 'System.Data.DataSet' does not contain a property with the name au_lname. "

2. Then another thing i want to include the datagrid in the usercontrol instead of text/label control. If i inlude in the databindings property what should i type in the custom binding expression.
For Text/Label control am using "DataBinder.Eval(((DataGridItem)Container).DataItem, "au_lname")" for datagrid what should i type.

Help me in this.
Title: @Sankar   
Name: Denis Bauer
Date: 2005-03-23 8:24:54 AM
Comment:
Different samples are available from my homepage. See the link above in section 2. The nested grid scenario is contained in the HierarGridDemo.

HTH
Denis
Title: Nested HierarGrids   
Name: Sankar
Date: 2005-03-23 8:19:48 AM
Comment:
I need sapmle code for Nested HierarGrids. Please help me in this.
Title: @Sankar   
Name: Denis Bauer
Date: 2005-03-23 6:23:42 AM
Comment:
Hi Sankar,

please take a look at section "3.7 Using the TemplateSelection event". It should be explained there. If you cannot figure it out please ping me directly. Contact is on my homepage.

Cheers
Denis
Title: I get the following message when I try to bind to the grid:   
Name: sankar
Date: 2005-03-23 1:01:34 AM
Comment:
Exception Details: System.ComponentModel.WarningException: Please use the event "TemplateSelection"
to specify which template to load for a child table/row

Can anyone help me on this.
my mail id : sankar_mscse@yahoo.co.in
Title: sql database setup   
Name: George
Date: 2005-03-18 2:49:21 PM
Comment:
Thank for the quick response..

It worked. What happend is I got alot of errors when I tried to copy and paste the sql create statements in the query analyzer (something about cant have group by without TOP) and so I did them one at a time and the 2 select statments didnt make it in the testdata sp.

thank you for the quick response.. it works great..
Title: To George   
Name: Denis Bauer
Date: 2005-03-18 2:30:01 PM
Comment:
Hi Goerge,

please leave your email address or contact me directly (address is on my homepage).

The stored proc contains three SELECT statement thus it should return three tables in your dataset. If you want to work around this problem, you can also use the TestData.xml file and load the data into a DataSet. The file is included in the HierarGridDemo which is available on my site.

Cheers
Denis
Title: Re: Help   
Name: Denis Bauer
Date: 2005-03-11 11:57:18 AM
Comment:
Hi Harmless,

thanks for your feedback and sorry for not giving you the guidance you need to successfully use the HierarGrid in your project. I usually work in larger projects where you certainly don't just drag-and-drop your tables on the designer surface and bind it to the controls but build a solid three-tier architecture with a separate application and data access layer. That's my "real world" and I still consider myself a human being. :) Therefore, it is sometimes a bit complicated to address a very diverse audience with a single article. But that's just a sidenote.

Basically, what I am trying to point out in my article is the fact, that the HierarGrid - as all other ASP.NET controls - is programmed to be DataSource-agnostic. In other (more "human being"-compatible) words the HierarGrid doesn't care where you get your data from or how you get it. As long as you end up with a DataSet that contains a DataRelation between a parent and one/several child tables everything is fine.

If you already know how to get your data into a DataSet and setup the DataRelation (which you seem to do) just skip chapter 3.1 and continue with 3.2.

Regarding your "Initialize Component" comment: True, that this is the code that VS.NET generates automatically for you. For my article I thought it was easier to write "just add that line" instead of:
Open up the webform in the designer, click on the events tab in the property windows and select the dropdown list for the TemplateSelection event.

If that seems easier for you, then you are free to choose.

Let me know if you run into any further issues (and leave an email address so that I can respond directly) or just download my VS.NET projects from my homepage.

Cheers
Denis
http://www.denisbauer.com
Title: HierarGrid   
Name: Karthikeyan
Date: 2005-03-10 9:09:56 AM
Comment:
Excellent... This article is very useful to me. Examples and sourcecode helped me in understanding the concept clearly.

Thanks
Title: Help   
Name: Harmless
Date: 2005-03-08 5:20:33 PM
Comment:
Is there a "I code like a human being" example for using this? When I setup datasets, sql connections, and data adapters I dont type all of this:

SqlConnection sqlConnection = new SqlConnection();
SqlCommand sqlCommand = new SqlCommand();

sqlConnection.ConnectionString =
"data source=(local);initial catalog=pubs;integrated security=SSPI;";
sqlCommand.CommandText = "[TestData]";
sqlCommand.CommandType = System.Data.CommandType.StoredProcedure;
sqlCommand.Connection = sqlConnection;
DataSet ds = new DataSet();

sqlConnection.Open();
SqlDataAdapter adap = new SqlDataAdapter(sqlCommand);

adap.Fill(ds);
sqlConnection.Close();

ds.Tables[0].TableName = "Titles";
ds.Tables[1].TableName = "Authors";
ds.Tables[2].TableName = "Sales";


... I just drop the table I want to work with from my sql server on my design view, configure my data adapter and sql queries, and then I generate my dataset from the data adapter. For setting up the dataset table relations I just double click on my (datasetname).xsd file in solution explorer and drag pkey/fkey relations from/to tables -- I dont type a whole bunch of code for doing this part because its not necessary in visual studio.net. Were your examples written for someone who uses Notepad? I wasnt sure becuase Intialize Component was mentioned and thats part of what would be generated vs.net code when you create a project...

Help -- give me a real example so I can figure out how to use your .dll
Title: paging on the nested grid   
Name: Alex
Date: 2005-03-03 5:51:04 PM
Comment:
Hi,

I can't get the paging to work on the nested grid. Can anyone provide a sample or let me know how to get it to work?

thanks
Alex
Title: DataGrid as Childrow problems   
Name: Y Chapman
Date: 2005-02-23 1:29:05 PM
Comment:
Hello,

I can't seem to figure out why my DataSet keeps evaluating to null.

For example,

DataSet ds = (DataSet) ((DataGridItem) this.bindingContainer).DataItem;

DataGrid1.DataSource = ds;
DataGrid1.DataMember = "tasks";
DataGrid1.DataBind();
Title: Thank you!!!   
Name: Cristina
Date: 2005-02-22 10:03:34 AM
Comment:
One million thanks for this :)! Is working and is great!
Title: How to download the file?   
Name: J Wright
Date: 2005-02-18 11:05:41 AM
Comment:
I cannot get to the page for the file. Keep getting a DNS error!
Title: @Rich   
Name: Denis Bauer
Date: 2005-01-09 1:59:36 PM
Comment:
Hi Rich,

thanks for the nice feedback. I am really interested in what features you've added because maybe some of them are general interest.

Thanks
Denis
Title: Great Job   
Name: Richard Turner
Date: 2005-01-07 9:54:35 AM
Comment:
I have been using this control for about two months now for one of our web projects and it works great. We have added a few more features but even these have been painless to add. Very well coded. Many thanks. Rich.
Title: Greate job   
Name: kids_pro
Date: 2004-11-29 9:57:35 PM
Comment:
Thank for the article I found it is very useful to my current and future projects. Many thanks
Title: Mr.   
Name: Viswanatha Swamy
Date: 2004-11-19 4:48:22 AM
Comment:
This article is great.
Title: MASTER-DETAIL-DETAIL RELATIONSHIP   
Name: Brundaban
Date: 2004-11-04 6:32:19 AM
Comment:
Nice code it helps me a lot.but i want to display a group of related records against each record of detail in another datagrid i.e parent-child-subchild rows from tables.

it would be a great help to me ,pls send solution
Title: HierarGrid   
Name: gsims@ldol.state.la.us
Date: 2004-11-02 9:53:16 AM
Comment:
The HierarGrid worked wonderfully for me. The only change I need is to show the column heading for the child rows. I've managed to format the child row columns but am unable to get the column headings.

Thanks.
Title: User Control Events into the Main Application   
Name: Gavin
Date: 2004-10-28 7:51:15 AM
Comment:
Excellent, really worked smoothly when I swapped over from a datagrid and added in the relationships.

One thing, I'm a bit stuck on, is trying to get an Event Handle from the User Control into the main page.

I'm trying OnBubbleEvent to do a DataBind on the main DataGrid from the usercontrol ...

Apart from that it's a great control
Title: Questions via EMail   
Name: Denis Bauer
Date: 2004-10-06 5:36:22 PM
Comment:
Hi Antonio & all,

please send me your questions via email so I can answer directly. The email address can be found on my homepage http://www.denisbauer.com/

Thanks
Denis
Title: HierarGrid   
Name: Antonio
Date: 2004-10-06 3:39:38 PM
Comment:
Hi,i´m try using HierarGrid but it´s give me one error.
when it´s load my webUserControl it´s show me this error:
"Exception of type System.StackOverflowException was thrown"
do u know what it´s?
i´ve seted this 2 propertys of my HierarGrid like this
TemplateCachingBase = TableName
TemplateDataMode = Table

on my webUserControl i´ve a single datagrid and a label.
it´s show my label but not a datagrid.
on datagrid_databind i´ve this code:
Dim dgi As DataGridItem = CType(Me.BindingContainer, DataGridItem)
If (Not (TypeOf dgi.DataItem Is DataSet)) Then
Throw New ArgumentException("Please change the TemplateDataMode attribute to 'Table' in the HierarGrid declaration")
End If

Dim ds As DataSet = CType(dgi.DataItem, DataSet)
DataGrid1.DataSource = ds
DataGrid1.DataMember = "SO_Telefones"
DataGrid1.DataBind()

thank you and sorry about my English
Title: Edit   
Name: Vikram Mewada
Date: 2004-10-05 5:52:11 AM
Comment:
Can i use this grid for taking data input for its each and
every item template row column. ?

Thanks
Vikram
vrmewada@yahoo.com
Title: Mr.   
Name: Ali
Date: 2004-10-03 8:17:11 AM
Comment:
I hope that User Control will work fine with my project.
Title: Hierargrid   
Name: shamas
Date: 2004-09-28 7:26:51 AM
Comment:
good... it would help me in my feature projects
Title: How to modify the plus image?   
Name: Alex Chan
Date: 2004-09-26 12:11:09 PM
Comment:
Hi,

I am trying out your control in my project. May I know how can I modify the image source for the plus image? Is there a properties to do so? Currently all my pictures are in Img directory.

In additional, I am trying out using a Datagrid in my Child row, but what are the databinding properties to set for?

If possible, you may contact me at alexccw@singnet.com.sg

Please help. Thanks.

Regards,
Alex Chan
Title: Mr   
Name: Paul Kent
Date: 2004-07-14 6:04:58 AM
Comment:
When ive used the Hierargrid, it crashes internet exployer if there is a lot of data in the grid! any idea how to fix this?
Title: Mr.   
Name: John Gossman
Date: 2004-06-15 3:31:03 PM
Comment:
I get the following message when I try to bind to the grid:

Please use the event "TemplateSelection" to specify which template to load for a child table/row
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ComponentModel.WarningException: Please use the event "TemplateSelection" to specify which template to load for a child table/row

Source Error:


Line 39: HG1.DataSource = ds;
Line 40: HG1.DataMember = "Running";
Line 41: HG1.DataBind();
Line 42: }
Line 43:

#################################################
This is my codebehind .cs file, I think it is seeing it because it doesn't error out when picking it up, it's just not initializing it.

using System;
using DBauer.Web.UI.WebControls.HierarGrid

namespace ProductionControl.Processing {

public class HG1 :DBauer.Web.UI.WebControls {

protected DBauer.Web.UI.WebControls.HierarGrid HG1

#region Web Form Designer generated code
public void InitializeComponent {
this.HG1.TemplateSelection += new HierarGridTemplateSelectionEventHandler(this.HG1_TemplateSelection);
}
end region
}
}

##########################################
I think this is the perfect control for what I need I just can't get it moving

I know this isn't a forum but if any one can help I would appreciate. And remember please I am new to the asp environment and to c#.

Please help JohnGossman@hcrec.com or kingjrg@aol.com

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2017 ASPAlliance.com  |  Page Processed at 2017-12-17 4:17:35 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search