Using the Telerik example, I tried to get the grid to show Master / Detail data. The master data binds fine, but the detail data doesn't show up at all.
The data in "C:\test.xml"
Any help is always appreciated, thanks.
<body> |
<form id="form1" runat="server"> |
<telerik:RadScriptManager runat="server" OutputCompression="AutoDetect"> |
</telerik:RadScriptManager> |
<div> |
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="200px" |
Width="100%"> |
<asp:Button ID="ParseButton" runat="server" Text="Parse" /><br /> |
<asp:TextBox ID="AcknowledgementTextBox" runat="server" Height="166px" |
TextMode="MultiLine" Width="100%"></asp:TextBox> |
<telerik:RadGrid ID="OutputGrid" runat="server" Skin="Web20" AutoGenerateColumns="false" AllowMultiRowSelection="false" GridLines="None"> |
<MasterTableView DataKeyNames="SegmentOrdinal" DataMember="Ak3"> |
<DetailTables> |
<telerik:GridTableView DataKeyNames="ElementOrdinal" DataMember="Ak4" Width="100%" runat="server" > |
<ParentTableRelation> |
<telerik:GridRelationFields DetailKeyField="SegmentOrdinal" |
MasterKeyField="SegmentOrdinal" /> |
</ParentTableRelation> |
<Columns> |
<telerik:GridBoundColumn DataField="ElementPosition" HeaderText="Element Position" UniqueName="ElementPosition" /> |
<telerik:GridBoundColumn DataField="ElementReferenceNumber" HeaderText="Element Reference Number" UniqueName="ElementReferenceNumber" /> |
<telerik:GridBoundColumn DataField="ElementErrorCode" HeaderText="Element Error Code" UniqueName="ElementErrorCode" /> |
<telerik:GridBoundColumn DataField="BadData" HeaderText="Bad Data" UniqueName="BadData" /> |
</Columns> |
</telerik:GridTableView> |
</DetailTables> |
<Columns> |
<telerik:GridBoundColumn DataField="SegmentIdCode" HeaderText="Segment ID Code" UniqueName="SegmentIdCode" /> |
<telerik:GridBoundColumn DataField="SegmentPosition" HeaderText="Segment Position" UniqueName="SegmentPosition" /> |
<telerik:GridBoundColumn DataField="LoopIdCode" HeaderText="Loop ID Code" UniqueName="LoopIdCode" /> |
<telerik:GridBoundColumn DataField="SegmentErrorCode" HeaderText="Segment Error Code" UniqueName="SegmentErrorCode" /> |
</Columns> |
</MasterTableView> |
</telerik:RadGrid> |
<asp:Label ID="ErrorLabel" runat="server" ForeColor="Red"></asp:Label> |
</telerik:RadAjaxPanel> |
</div> |
<telerik:RadAjaxManager runat="server"> |
<AjaxSettings> |
<telerik:AjaxSetting AjaxControlID="RadAjaxPanel1"> |
<UpdatedControls> |
<telerik:AjaxUpdatedControl ControlID="OutputGrid" /> |
<telerik:AjaxUpdatedControl ControlID="ErrorLabel" /> |
</UpdatedControls> |
</telerik:AjaxSetting> |
</AjaxSettings> |
</telerik:RadAjaxManager> |
</form> |
</body> |
Protected Sub ParseButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ParseButton.Click |
Try |
ErrorLabel.Text = "" |
'Dim interchange As New AnsiClient.InterchangeControl(AcknowledgementTextBox.Text) |
'AcknowledgementTextBox.Text = interchange.ToString.Replace(interchange.Delimiters.SegmentDelimeter, interchange.Delimiters.SegmentDelimeter & Environment.NewLine) |
'Dim ack = DirectCast(interchange.FunctionalGroups(0).Transactions(0), Acknowledgment) |
'ParseAcknowledgement(ack) |
Dim ds As New System.Data.DataSet |
ds.ReadXml("C:\test.xml") |
OutputGrid.DataSource = ds |
OutputGrid.DataBind() |
Catch ex As Exception |
ErrorLabel.Text = ex.ToString |
End Try |
End Sub |
<?xml version="1.0" standalone="yes"?> |
<Data xmlns="http://tempuri.org/Data.xsd"> |
<Ak3> |
<SegmentIdCode>EB</SegmentIdCode> |
<SegmentPosition>40</SegmentPosition> |
<LoopIdCode>2110C</LoopIdCode> |
<SegmentErrorCode>SegmentHasDataElementErrors</SegmentErrorCode> |
<SegmentOrdinal>1</SegmentOrdinal> |
</Ak3> |
<Ak3> |
<SegmentIdCode>EB</SegmentIdCode> |
<SegmentPosition>42</SegmentPosition> |
<LoopIdCode>2110C</LoopIdCode> |
<SegmentErrorCode>SegmentHasDataElementErrors</SegmentErrorCode> |
<SegmentOrdinal>2</SegmentOrdinal> |
</Ak3> |
<Ak4> |
<ElementPosition>9</ElementPosition> |
<ElementReferenceNumber>673</ElementReferenceNumber> |
<ElementErrorCode>ConditionalRequiredDataElementMissing</ElementErrorCode> |
<BadData>VS</BadData> |
<SegmentOrdinal>1</SegmentOrdinal> |
<ElementOrdinal>1</ElementOrdinal> |
</Ak4> |
<Ak4> |
<ElementPosition>9</ElementPosition> |
<ElementReferenceNumber>673</ElementReferenceNumber> |
<ElementErrorCode>ConditionalRequiredDataElementMissing</ElementErrorCode> |
<BadData>VS</BadData> |
<SegmentOrdinal>2</SegmentOrdinal> |
<ElementOrdinal>2</ElementOrdinal> |
</Ak4> |
</Data> |
Any help is always appreciated, thanks.