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.

How can i get the mepping in WPF on a nested table?

Thread ID:

Created:

Updated:

Platform:

Replies:

114175 Nov 1,2013 07:07 AM Nov 20,2013 08:55 AM WPF 2
loading
Tags: GridControl
Sean Roddis
Asked On November 1, 2013 07:07 AM

Hallo,

I have a DataGridControl, which has a ObservableCollection<DataRowModel> as ItemSource.
The DataRowModel, have a nother ObservableCollection<Childrin>.

In WPF I create my own mapping for the columns and have AutoPopulateColumns= false, everything works finde... but how can I create a mapping for the childrin/nested table?
Is there any way in WPF? (cous i do MVVM, and dont want to to it in the codebehind)

Regards,

Sean Roddis

WPFGuru
Replied On November 5, 2013 04:41 PM

I think you can simplify the "waiting for good answers" job and I can recommend you a very good guide that can help you in your projects. It has great examples and for me it was very helpful: Beginning WPF 4.5 by full example. 

Good luck!

Gobinath A [Syncfusion]
Replied On November 20, 2013 08:55 AM

Hi Sean Roddis,

 

Sorry for the delay in getting back to you.

 

We have analyzed your query and you can create the Mapping name for nested grid by using the following code snippet.

 

Code snippet[XAML]:

  <syncfusion:GridDataControl.Relations >

                <syncfusion:GridDataRelation RelationalColumn="Collection" RelationType="MasterDetails" >

                    <syncfusion:GridDataRelation.TableProperties>

                        <syncfusion:GridDataTableProperties AutoPopulateColumns="False" >

                            <syncfusion:GridDataTableProperties.VisibleColumns>

                                <syncfusion:GridDataVisibleColumn MappingName="CustomerID" HeaderText="Id"/>

                                <syncfusion:GridDataVisibleColumn MappingName="CustomerName" HeaderText="Name"/>

                                <syncfusion:GridDataVisibleColumn MappingName="ProductID" HeaderText="ProductId"/>

                            </syncfusion:GridDataTableProperties.VisibleColumns>

                        </syncfusion:GridDataTableProperties>

                    </syncfusion:GridDataRelation.TableProperties>

                </syncfusion:GridDataRelation>

            </syncfusion:GridDataControl.Relations>

           

 

 

We have prepared simple sample base on your requirement and please find the sample under the following location.

 

Sample: NestedWithObservable.zip

 

Please let us know if you have any queries.

 

Regards,
Gobinath A.


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.

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.

;