Home Forums WPF controls Xceed DataGrid for WPF Showing properties of inner object of binded collection

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • User (Old forums)
    Post count: 23064
    #25943 |

    I have a collection of Element objects which is:
    public class Element {
    public Name {
    get {return name;}

    public object getContent() {return content;}

    private String name;
    private object content;

    Where content is an instance of unknown class with its own properties. How do I display properties of content field instead of properties of an Element object?

    If I had a collection of objects of that unknown type I would have got it automatically.

    Imported from legacy forums. Posted by Alexander (had 1844 views)

    Xceed Support
    Post count: 5658

    You can change a column’s DisplayMemberBinding property to display the value of a sub-property. For example:

    <xcdg:Column FieldName=”Element” Title=”Location” DisplayMemberBinding=”{Binding Path=”Content.Something””/>

    Of course, this assumes that you have a property named Content that returns the value of getContent.

    Imported from legacy forums. Posted by Jenny [Xceed] (had 2958 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.