Home Forums WPF controls Xceed DataGrid for WPF DataBinding to LINQ query

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #25897 |

    Hey There,

    So im somewhat new to LINQ/WPF and im trying to figure out how to use the DataGrid in an XBAP project for the company i work for.

    I have the data in LINQ objects and followed the Getting Started stuff, and some other code i found online to generate a DataTable from a LINQ query.

    So basically my question is, in my table i have relationships that point to other objects, which have their own properties. how do i access the values of those other objects? here is an example:

    Users object has a Location object which has a Name property. My grid is displaying all the users in the users table, but the location is currently showing up as <namespace>.Location.

    How do i access the Name property of the Location object to display in the grid?

    thanks for your help

    Imported from legacy forums. Posted by Jason (had 2359 views)

    User (Old forums)
    Member
    Post count: 23064

    try something like this:

    <xcdg:Column FieldName=”LocationName” Title=”Location” DisplayMemberBinding=”{Binding Path=Location.Name}”/>

    Alex

    Imported from legacy forums. Posted by Alex (had 345 views)

    User (Old forums)
    Member
    Post count: 23064

    awesome, works great, thanks.

    Imported from legacy forums. Posted by Jason (had 3361 views)

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