<?xml version="1.0" encoding="utf-8"?> |
<Invoices> |
<Invoice> |
<InvoiceNumber>456789</InvoiceNumber> |
<JobNumber>TTT</JobNumber> |
<CreateDate>01/03/2009 12:23:34</CreateDate> |
<Parts> |
<Part> |
<PartNumber>001</PartNumber> |
<PartDescription>Part Number 1 has expection</PartDescription> |
<PartPrice>12.99</PartPrice> |
</Part> |
<Part> |
<PartNumber>002</PartNumber> |
<PartDescription>No Part available</PartDescription> |
<PartPrice>60.00</PartPrice> |
</Part> |
</Parts> |
</Invoice> |
<Invoice> |
<InvoiceNumber>0000</InvoiceNumber> |
<JobNumber>SSSS</JobNumber> |
<CreateDate>01/01/2001 11:00:00</CreateDate> |
<Parts> |
<Part> |
<PartNumber>003</PartNumber> |
<PartDescription>Part Number3 has expection</PartDescription> |
<PartPrice>42.99</PartPrice> |
</Part> |
<Part> |
<PartNumber>004</PartNumber> |
<PartDescription>4 Part available</PartDescription> |
<PartPrice>100.00</PartPrice> |
</Part> |
</Parts> |
</Invoice> |
</Invoices> |
so table diagram is "Invioce" -> "InvoiceParts" ->"Parts"
any sample codes how to implement it?
here is my source code
Dim mO As New XMLOperater |
grdvewCurrentParts.DataSource = mO.XMLToDataSet("C:\xmlfile.xml").Tables(0) |
Dim template As Telerik.WinControls.UI.GridViewTemplate = New Telerik.WinControls.UI.GridViewTemplate |
template.DataSource = mO.XMLToDataSet("C:\xmlfile.xml").Tables(1) |
grdvewCurrentParts.MasterGridViewTemplate.ChildGridViewTemplates.Add(template) |
Dim template2 As Telerik.WinControls.UI.GridViewTemplate = New Telerik.WinControls.UI.GridViewTemplate |
template2.DataSource = mO.XMLToDataSet("C:\xmlfile.xml").Tables(2) |
template.ChildGridViewTemplates.Add(template2) |
grdvewCurrentParts.MasterGridViewTemplate.ChildGridViewTemplates.Add(template2) |
Dim relation As GridViewRelation = New GridViewRelation(grdvewCurrentParts.MasterGridViewTemplate) |
Dim relation2 As GridViewRelation = New GridViewRelation(grdvewCurrentParts.MasterGridViewTemplate.ChildGridViewTemplates(template)) |
relation.ChildTemplate = template |
relation2.ChildTemplate = template2 |
relation.ParentColumnNames.Add("Invoice_Id") |
relation.ChildColumnNames.Add("Invoice_Id") relation2.ParentColumnNames.Add("Parts_Id") |
relation2.ChildColumnNames.Add("Parts_Id") |
grdvewCurrentParts.Relations.Add(relation) |
grdvewCurrentParts.Relations.Add(relation2) |