This is a migrated thread and some comments may be shown as answers.

radgridview bind complex object

1 Answer 88 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Anatol
Top achievements
Rank 1
Anatol asked on 27 Jan 2018, 04:23 PM

Hello

I have complex class like this:

class person
    {
        string name;
        car Car;
    }
    
    class car
    {
        string model;
        string number;
    }

////////////////////////

 ObservableCollection<person> persons  = getAllPerson() ;

mainDG.ItemSource = persons;

////////////////////////

How can I bind it to my RadgridView?

<telerik:RadGridView x:Name="mainDG" Margin="259,0,5,5" AutoGenerateColumns="False" >
                        <telerik:RadGridView.Columns>

                                  <telerik:GridViewDataColumn Header="Car number" DataMemberBinding="{Binding Car.number}"/>//How can I bind it?

                       </telerik:RadGridView.Columns>

</telerik:RadGridView>

1 Answer, 1 is accepted

Sort by
0
Anatol
Top achievements
Rank 1
answered on 30 Jan 2018, 05:45 AM
I am sorry. I m stupid.  I have understood how to do it
Tags
General Discussions
Asked by
Anatol
Top achievements
Rank 1
Answers by
Anatol
Top achievements
Rank 1
Share this question
or