I want to display the a child table inside a xamdatagrid.
<igDP:XamDataGrid DataSource="{Binding DataContext.ViewSetList,RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:MainWindow}} }" > <igDP:XamDataGrid.FieldLayouts> <igDP:FieldLayout> <igDP:FieldLayout.Fields>
<igDP:Field Name="PARAMETER"> <igDP:Field.Settings> <igDP:FieldSettings AllowEdit="False" /> </igDP:Field.Settings>
</igDP:Field>
<igDP:Field Name="VALUE" > <igDP:Field.Settings> <igDP:FieldSettings AllowEdit="False" /> </igDP:Field.Settings> </igDP:Field>
</igDP:FieldLayout.Fields>
</igDP:FieldLayout> </igDP:XamDataGrid.FieldLayouts>
</igDP:XamDataGrid>
I want to bind this <igDP:Field Name="VALUE" > field to another another data table. Is there any possible solutions
Hello Akshay,
I am glad that you were able to achieve the functionality you were looking for.
You can take a look at Microsoft Docs, especially this topic:
Data Binding Overview
You can find a thorough description about Data Binding
As you can see in the description ("Current Item Pointers"), WPF binds to a collection only by using a view (either a view you specify, or the collection's default view), all bindings to collections have a current item pointer. When binding to a view, the slash ("/") character in a Path value designates the current item of the view. In your scenario in the collection Parameters(ViewSetList) the TableData is a property which represents the current data, which is DataTable.Sincerely,NickEntry-Level Software Developer
Thanks Nick. It was a binding issue. I managed to get the table inside a table.
I have couple of questions here.
1. Why you have used Data ParameterList/tableData. Cant we use ParameterList.Tabledata for binding?
2. Is there any good source to learn WPF complex bindings other then MSDN.
Thanks
Akshay
Hello AKshay,
I have modified the sample you have sent and added the functionality we discussed. When I run the project there are two XamDataGrids, and the child is populated with DataTable as you can see in the screenshot from my previous post.
Please test this project on your PC; whether or not it works correctly may help indicate the nature of this issue.
If the project does show the XamDataGrid populated, this indicates that something in your application prevents the DataTable to be displayed (e.g. styles, data binding, etc.).
If the project does not work correctly, this indicates either a problem possibly specific to your environment, or a difference in the DLL versions we are using. My test was performed using version 17.1.20171.2073.
Sincerely,NickEntry-Level Software Developer
Hi Nick,
i tried your Suggestion but no table is populated. So i decided to convert Data table to string. and just show the string inside that parent table.
i.e Parameter VALUE = convertDataTableToString(Datatable); //this function will convert data table to string with rows and columns
During the debugging the i checked the Value it is showing like IMAGE 1
https://drive.google.com/open?id=1Ph8T0jAXc73zNANtZ7N3YG3nNHvcBYSx
and final output is like this
https://drive.google.com/open?id=1vsWbI94GSMNqhNP07iqTmJ6T41T2FlII
Will Xamdatagrid will remove the spaces from the string?
Thank you for the image you have sent,
You referred in your last post to field VALUE. If you look at it there is a scrollbar which was activated because the XamDataGrid is too small.You will be able to view the XamDataGrid if you increase the CellHeight, for example:
<igDP:XamDataGrid DataSource="{Binding ViewSetList,RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:MainWindow}} }" > <igDP:XamDataGrid.FieldSettings> <igDP:FieldSettings CellHeight="100"/> </igDP:XamDataGrid.FieldSettings>.....