We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridDataControl not showing correct parent -child relationship for tables related by two DataColumns

Thread ID:

Created:

Updated:

Platform:

Replies:

131475 Jul 11,2017 04:31 PM Jul 23,2017 04:35 AM WPF 3
loading
Tags: GridDataControl
Steve McWilliams
Asked On July 11, 2017 04:31 PM

I have a GridDataControl intended to show a subordinate table ("TestData") related to the parent ("TestResults") related by "Output Name" and "Test Name" columns.
Attached JPG shows expanded child table for first parent row showing rows for first three parent rows. I suppose I am not defining the relationship correctly.
I am using Visual Studio 2015 and Syncfusion version 15.2.0.40 

Also, when I collapse the child table, I get a InvocationException error (also attached) which seems to be due to a missing key, probably also due to incorrect table setup.

XAML excerpt:

            <syncfusion:TabItemExt Header="Test Results"

                          <syncfusion:GridDataControl x:Name="testResultsGrid"   Margin="5"               

                    AutoPopulateColumns="True"

                    AutoPopulateRelations="True"

                    HideEmptyChildGrid="True"

                    ShowAddNewRow="False" AllowEdit="False" AllowDelete="False" ColumnSizer="Auto" EnableTriStateSorting="True"

                    ResizingColumns="dataGrid_ResizingColumns"/>


Code behind:

            DataTable testResultsTable = new DataTable("TestResults");

            dataSet.Tables.Add(testResultsTable);

            testResultsTable.Columns.Add("Output Name", typeof(string));

            testResultsTable.Columns.Add("Test Name", typeof(string));

            testResultsTable.Columns.Add("Test Type", typeof(string));

            testResultsTable.Columns.Add("Test Passed", typeof(string));

            testResultsTable.Columns.Add("Test Result", typeof(string));

            testResultsTable.Columns.Add("Action", typeof(string));

            testResultsTable.Columns.Add("Explanation", typeof(string));

          ...

            DataTable testDataTable = new DataTable("TestData");

            dataSet.Tables.Add(testDataTable);

            testDataTable.Columns.Add("Output Name", typeof(string));

            testDataTable.Columns.Add("Test Name", typeof(string));

            testDataTable.Columns.Add("Test Data", typeof(string));

 

            var trtColumns = new DataColumn[] { testResultsTable.Columns["Output Name"], testResultsTable.Columns["Test Name"] };

            var tdtColumns = new DataColumn[] { testDataTable.Columns["Output Name"], testDataTable.Columns["Test Name"] };

            dataSet.Relations.Add("dataRelation",trtColumns, tdtColumns);





Attachment: Table_35e7fcc5.zip

Muthukumar Kalyanasundaram [Syncfusion]
Replied On July 12, 2017 01:37 PM

Hi Steve, 
 
Thank you for contacting Syncfusion support. 
 
We have checked your query. We were unable to reproduce the reported “GridDataControl not showing parent & child relationship for tables” in our side. For your reference, we have attached the sample file in the below location. In the sample, we have loaded GridDataControl with relation of parent & child relationship. 
 
  
Could you please share some more information about your query as like,  
  1. For which scenario, you have get an error on you application.
  
If it’s possible, could you please revert by modifying the attached sample based on your application along with the replication procedure?. This would be helpful for us to provide an appropriate solution as soon as possible.   
 
Regards, 
Muthukumar K 


Steve McWilliams
Replied On July 12, 2017 03:36 PM

OK, I modified your sample solution to show the scenario that I think is wrong. You can see that the parent row for 'Output1 / txtName1' compound key shows child testData table rows for Output1/ txtName1, Output1/ txtName2 and Output1/txtName3.

I want parent row for Output1 and txtName1 to only show child row 'Output1 txtName1 data0'.

Right now, all three parent rows for Output1/ txtNameX   show all three child rows for Output1. It seems not to try and match on TestName column at all.


Attachment: Test_dc6f3e18.zip

Muthukumar Kalyanasundaram [Syncfusion]
Replied On July 23, 2017 04:35 AM

Hi Steve,  
 
Sorry for the delay. 
 
We were able to reproduce the issue and have logged defect report regarding this. A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates,  
 
 
Please let me know if you have any questions.  
 
Regards, 
Muthukumar K 



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;