Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

HierarGrid 3.9 Displaying one template for all child rows

Posted on 2006-06-06
3
Medium Priority
?
498 Views
Last Modified: 2012-05-05
Hi,

Please assist where do we place the code below..I'm lost on where I should place it. I'm using visual web developer 2005 express edition.

Thanks.

http://aspalliance.com/articleViewer.aspx?aId=21&pId=#Page1

>>>
3.9 Displaying one template for all child rows

You could change the Authors.ASCX file described above by dropping a DataGrid instead of a TextBox. In the code-behind you can then use the normal DataBinding syntax to bind a DataSet to the grid. This DataSet of child rows can be taken from the BindingContainer property:

[VB]
Dim dgi as DataGridItem = CType(Me.BindingContainer, DataGridItem)
Dim ds as DataSet = CType(dgi.DataItem, DataSet)
DG1.DataSource = ds
DG1.DataMember = "Authors"
DG1.DataBind()
<<<
0
Comment
Question by:RyanBank
  • 2
3 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 2000 total points
ID: 16843259
I don't have access to that web page.  Can you tell me what it says?

Bob
0
 

Author Comment

by:RyanBank
ID: 16843354
on the site:
>>
3.9 Displaying one template for all child rows
The sample described above relies on displaying a template for each child row. E.g. when a book has two authors and has been sold three times the total number of templates loaded is five. Imagine you want to change this to display a nested DataGrid for all the authors and a DataGrid for all the sales under book.

This can be achieved by setting the TemplateDataMode to "Table" instead of "SingleRow" (its default value). Doing so loads only one template per child table.

You could change the Authors.ASCX file described above by dropping a DataGrid instead of a TextBox. In the code-behind you can then use the normal DataBinding syntax to bind a DataSet to the grid. This DataSet of child rows can be taken from the BindingContainer property:
[VB]
Dim dgi as DataGridItem = CType(Me.BindingContainer, DataGridItem)
Dim ds as DataSet = CType(dgi.DataItem, DataSet)
DG1.DataSource = ds
DG1.DataMember = "Authors"
DG1.DataBind()
<<

I have set the  TemplateDataMode to "Table" and created the Authors.ASCX manually since Visual webdeveloper can't open/create projects. where do I place that code he was saying? I already place a datagrid into the authors.ascx



0
 

Author Comment

by:RyanBank
ID: 16843463
I'm lost because I dont use code behind when editing. I use a straight down aspx file. where the subs are above the page ans html below. sorry for the confusion.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses
Course of the Month11 days, 13 hours left to enroll

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question