I have a ListView in WPF that is databound to a basic table that I pull from the database. The code for the ListView is as follows:
<ListView Canvas.Left='402' Canvas.Top='480' Height='78' ItemsSource='{Binding}' Name='lsvViewEditCardPrint' Width='419'> <ListView.View> <GridView> <GridViewColumn DisplayMemberBinding='{Binding Path=IdCst}'>Set</GridViewColumn> <GridViewColumn DisplayMemberBinding='{Binding Path=Language}'>Language</GridViewColumn> <GridViewColumn DisplayMemberBinding='{Binding Path=Number}'>Number</GridViewColumn> <GridViewColumn DisplayMemberBinding='{Binding Path=IdArt}'>Artwork</GridViewColumn> </GridView> </ListView.View> </ListView>
The IdCst column is a foreign key to a separate table, and I’d like to display the actual name field from that table instead of just the Id. Does anybody know how to set a databinding, or is there an event, such as OnItemDataBound, that I could intercept to modify the display?
This blog post may help: