I am using VS2010 with 2011.1 controls with VB.NET. I have 3 unnamed datatables that are returned as a single dataset in the code behind. I need to bind this dataset to a WebHierarchicalDataGrid. I do not wish to display any headers and would like to add an unbound checkbox as the first column in each row. When I check "Metal", the grid will expand to show "Ratt" and "Whitesnake". If I expand "Whitesnake", the grid will expand to show "Slide it in". Pretty simple in concept but I cannot for the life of me get it to work even after looking at several code examples. Thanks for the help!
Hello jdymond,I would suggest you to use one Self-Reference table instead of these three. For example:
ID PARENTID NAME 1 null Metal 2 null Rock 2 1 Ratt 3 1 Whitesnake 4 2 Van Halen 5 3 Out of the Cellar 6 3 Invasion of your Privacy 7 4 Slide it in 8 5 Fair Warning
Please find the attached Sample and let me know if you need additional assistance
Hmmm... Can't really do that. Is there a way to accomplish what I was asking? Appreciate the help! VB.NET would be even better. Thanks!!!
What would the code look like if we defined the columns and bands in the .aspx page? Still trying to get a feel for what the grid can do... Thanks!
The markup for the attached sample should look lite this:
<ig:WebHierarchicalDataGrid ID="WebHierarchicalDataGrid1" runat="server" Height="350px" Width="400px" DataKeyFields="ID" DataMember="Genres" AutoGenerateBands="False" AutoGenerateColumns="False" Key="Genres"> <Bands> <ig:Band AutoGenerateColumns="False" DataMember="Bands" Key="Bands" DataKeyFields="ID"> <Bands> <ig:Band AutoGenerateColumns="False" DataMember="Songs" Key="Songs" DataKeyFields="ID"> <Columns> <ig:BoundDataField DataFieldName="ID" Key="ID"> <Header Text="ID" /> </ig:BoundDataField> <ig:BoundDataField DataFieldName="ParentID" Key="ParentID"> <Header Text="ParentID" /> </ig:BoundDataField> <ig:BoundDataField DataFieldName="Name" Key="Name"> <Header Text="Name" /> </ig:BoundDataField> </Columns> </ig:Band> </Bands> <Columns> <ig:BoundDataField DataFieldName="ID" Key="ID"> <Header Text="ID" /> </ig:BoundDataField> <ig:BoundDataField DataFieldName="ParentID" Key="ParentID"> <Header Text="ParentID" /> </ig:BoundDataField> <ig:BoundDataField DataFieldName="Name" Key="Name"> <Header Text="Name" /> </ig:BoundDataField> </Columns> </ig:Band> </Bands> <Columns> <ig:UnboundCheckBoxField Key="Check" HeaderChecked="False"/> <ig:BoundDataField DataFieldName="ID" Key="ID"> <Header Text="ID" /> </ig:BoundDataField> <ig:BoundDataField DataFieldName="ParentID" Key="ParentID"> <Header Text="ParentID" /> </ig:BoundDataField> <ig:BoundDataField DataFieldName="Name" Key="Name"> <Header Text="Name" /> </ig:BoundDataField> </Columns> </ig:WebHierarchicalDataGrid>
This works well. However, does this put a checkbox in front of each row in the grid? Thanks.
The checkboxes were not displaying in the child bands. However I found another post that mentioned this was a known bug and would be fixed if you apply the 20111.2036 patch. I have applied the patch and it is now working. Good job guys!
Hello jdyamond,
this service release 2036 is already avaiable for download. Plese find the attached sample. Let me know if you have any further questions.
I have it already thanks. Works great! Thanks for all of your help.