views:

37

answers:

1

I want to bind a column of my DataGrid to a nested property.

I have defined these two classes:

public class ViewObj
{
    public cCar car { get; set; }
    public string name { get; set; }
}

public class cCar
{
    public int ps { get; set; }
    public int wheels { get; set; }
}

The class cCar is a property of the class ViewObj.

I also have a List<ViewObj>, which I bind to my DataGrid.

I want bind the "wheels" property to the first column of the Datagrid.

How can I access the "wheels" property of the cCar class, that is part of the ViewObj class, from the DataGrid?

Thanks!

A: 

Try

{Binding car.wheels}
Aliostad