Hi folks, I wanted to announce
my frist article on ASPAlliance which is a tutorial about how to use the HierarGrid, a hierarchical DataGrid that displays master-detail relations. Any feedback is appreciated. Denis
Dennis, I have been fooling around with your hierargrid for the last day and a half. Maybe you can help me out with a problem. I am trying to use nested hierargrids to drill down about four levels. With some adjustments to get the correct handles on the datasource
I have accomplished this. However whenever I try to use TemplateDataMode= "Table" I receive an "Invalid Cast Exception". Additional info as follows: Your article/example says that the way to extract the datasource is as follows: dim dgi as datagriditem = ctype(me.bindingcontainer,datagriditem)
dim ds as dataset = ctype(dgi.dataitem,dataset) I cannot seem to get this to work as advertised. The appropriate cast seems to be into a datarowview. I can then create a child view off of this which produces the expected results. Thanks
Hi Brian, thanks for your feedback. Did you download version 1.3 published on Mon 25? I fixed a bug that may be the problem you are encountering. "When the TemplateDataMode attribute was set to Table and the Grid was bound to a DataSet instead of a DataTable
a cast error occurred in line 319 (thanks to Johannes Rest)" http://www.denisbauer.com/weblog/PermaLink.aspx?guid=6700b526-a39b-4b2a-ac37-bed8147f0971 If this does not resolve your issue, could you please send me some code snippets via email (see address in
my profile) HTH Denis
Hi Denis Very nice job on the control. 2 questions which are related 1. I am trying to build a tree like based on one table (related by catid to parentid). Do you have some pointers on this. At any leve, I can include a template wich in my case is a grid of
items. 2. I am trying to access the columns collection and it is always set to 0. The reason being is that I retrieve 5 fields but would like only 2 fields to be visible. Thanks and looking forward to the updates. Idriss
I have downloaded it(2003.8.25 version), and found that this question still exists. When TemplateDataMode="Single Row", the program work well; but when TemplateDataMode="Table" and change ascx as the http://www.aspalliance.com/denisb/Articles/HierarGrid.aspx
, it tell me "Invalid Cast Exception". Is there something wrong?
Hi Idriss, sorry for not responding earlier. For some reason I haven't received a new answer email notification. Regarding your two questions. 1) Currently I don't have a sample for that ready to publish but I'll be creating one the next few days as I have
received numerous requests for it. 2) Like with the standard DataGrid the columns collection is only filled when AutoGenerateColumn is set to false. So please make sure you change that accordingly. HTH Denis
What I have been able to surmise is that the cast has to be into a datarowview, then you can create a child view off of that. Here is sample code that i've gotten to work.
Dim dgi As DataGridItem = CType(Me.BindingContainer, DataGridItem)
Dim drv As DataRow = CType(dgi.DataItem.row, DataRowview)
HierarGrid1.DataSource = drv.CreateChildView("ProjTask")
HierarGrid1.DataBind()
(Have changed my code several times while trying different things but I think this
works).
Most of the feedback emails I recieved during the last two weeks asked for guidance on using HierarGrid.TemplateDataMode=Table. This flag can be used to nest a DataGrid or another HierarGrid inside the child template. Therefore, I extended the HierarGridDemo
by another page called NestHierarGridDemo.aspx that shows how to build 3 layers of grids. You can view and download the demo here (sourcode available in VB.NET and C#). Thanks Denis
Hello Denis. Great control you've written there. I came across your HeirarGrid control while searching the internet, as I would like to include it on a small personal family weblog that I'm in the middle of developing. I have managed to figure out how to use
it on my own, using your demos and code snippets to guide me, however I have run into a wall on one issue: I am trying to add an imagebutton (or possibly some other control) to the parent row (so moderators can delete entries in my weblog) of the heirargrid.
So far, the only data I am displaying in my parent rows is coming from my database in the databind() call. I have managed to add whatever controls I want in the child-rows, as they are contained in the custom web control they are associated with. Is it possible
to add a control in the parent rows? Thanks for any help you can offer... Chris Pielak
DBauer
Member
260 Points
52 Posts
Microsoft
Article about the HierarGrid V1.0
Aug 19, 2003 01:58 PM|LINK
Microsoft Germany
My ASP.NET Homepage
This posting is provided "AS IS" with no warranties, and confers no rights.
brianF
Member
95 Points
19 Posts
Re: Article about the HierarGrid V1.0
Sep 01, 2003 12:18 AM|LINK
DBauer
Member
260 Points
52 Posts
Microsoft
Re: Article about the HierarGrid V1.0
Sep 01, 2003 09:46 AM|LINK
Microsoft Germany
My ASP.NET Homepage
This posting is provided "AS IS" with no warranties, and confers no rights.
idrissb
Member
10 Points
2 Posts
Re: Article about the HierarGrid V1.0
Sep 01, 2003 05:46 PM|LINK
kjhzjb
Member
5 Points
1 Post
Re: Article about the HierarGrid V1.0
Sep 04, 2003 05:58 AM|LINK
DBauer
Member
260 Points
52 Posts
Microsoft
Re: Article about the HierarGrid V1.0
Sep 04, 2003 08:52 AM|LINK
Microsoft Germany
My ASP.NET Homepage
This posting is provided "AS IS" with no warranties, and confers no rights.
idrissb
Member
10 Points
2 Posts
Re: Article about the HierarGrid V1.0
Sep 04, 2003 02:23 PM|LINK
brianF
Member
95 Points
19 Posts
Re: Article about the HierarGrid V1.0
Sep 04, 2003 02:45 PM|LINK
Dim dgi As DataGridItem = CType(Me.BindingContainer, DataGridItem) Dim drv As DataRow = CType(dgi.DataItem.row, DataRowview) HierarGrid1.DataSource = drv.CreateChildView("ProjTask") HierarGrid1.DataBind()(Have changed my code several times while trying different things but I think this works).DBauer
Member
260 Points
52 Posts
Microsoft
Nested hierarchical grid demo using the HierarGrid 1.4
Sep 08, 2003 10:26 PM|LINK
Microsoft Germany
My ASP.NET Homepage
This posting is provided "AS IS" with no warranties, and confers no rights.
cfpielak
Member
34 Points
10 Posts
Re: Article about the HierarGrid V1.0
Sep 11, 2003 05:54 PM|LINK