HierarGrid

Denis Bauer has just posted a new article on AspAlliance about his HierarGrid control.  This is a very nice control for displaying hierarchical relationships in a Datagrid, including the ability to expand and collapse child rows (client-side).
Published Monday, August 18, 2003 9:04 AM by datagridgirl

Comments

# re: HierarGrid

Isn't it a good sign if the one and only authority in DataGrid controls is referring to my article ;)

Thanks a lot, Marcie!

Sunday, August 24, 2003 5:03 PM by Denis Bauer

# re: HierarGrid

Seems to be a great control , excellent effort.

Works fine with the sample application proveded - where data source is read from an xml file.

I m using SQL db(northwind ) and tried it for tabels [Parent as] 'customer' and [Child as] 'order' (relation of field 'customerid')

In the child child template file i have a simple asp.net datagrid control and to bind this child contorl i use the code as said, but unfortunately get following error when typecasting the (..dgi..)datagriditem to data set:

"Specified cast is not valid."
i m pasting the code i m using to bind the datagrid in the child template

Dim dgi As DataGridItem = CType(Me.BindingContainer, DataGridItem)
Dim ds As DataSet = CType(dgi.DataItem, DataSet)
dg.DataSource = ds
dg.DataMember = "orders"
dg.DataBind()
----------------------

Friday, February 06, 2004 4:58 PM by rohangandhi@yahoo.com

# re: HierarGrid

Your DataGridItem should most likely be cast to DataRowView, rather than DataSet

DGG

Friday, February 06, 2004 5:10 PM by Datagrid Girl

# re: HierarGrid

Hello!

Excellent control! I'm experiencing the same issue as the person above, but only when using a SQL database. The sample application that uses XML data seems to be fine. This cast error crops up during postback only, not compilation. My research shows that it's an issue with viewstate. See this article from Microsoft: <a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;Q327287">http://support.microsoft.com/default.aspx?scid=kb;en-us;Q327287</a>. Its solution is:

Make sure that the control tree is re-created on postback in the same order that it was saved at the end of the previous request.

In respect to the HierarGrid control, how can this solution be implemented?

Thanks for any input!
PK

Thursday, April 08, 2004 4:14 PM by PK (philitsa.kontos@linedata.com)

# re: HierarGrid

I know it's a bit late, but maybe someone will come looking to the same page.

2 points that can cuase this problem:

1. Not setting the property of the HierarGrid.TemplateDataMode to "Table"

2. Trying to bind too soon - Try Page Events-OnDataBinding - my experience with using Page_Load indicates that it's only on DataBinding that the dataset gets passed over.

If any of the original posters here pick this up, please tell me what you are using now instead of HierarGrid - I'm programming in ASP.NET 2.0 a la VB and I couldn't get the Gridview to do what this did!

Thanks, hope this helps someone when google indexes it!

ooh, ooh, google keywords

MASTER CHILD GRIDVIEW DATAGRID HIERARGRID VB.NET HIERARCHICAL

!!!!!!

Friday, April 25, 2008 10:28 AM by Andy Clark

Leave a Comment

(required) 
(required) 
(optional)
(required)