views:

35

answers:

1

Using Silverlight4, how can I make datagrid grouping look up a display name from another table when the grouping value is a foreign key?

I could denormalise the entity so that it resolves the join itself but this introduces update issues. The approach that leaps to mind is a value converter and I shall look into it, but if you have a definite answer any advice would be appreciated.

NOTE Using a join inside a view works nicely, although you do then have to explicitly handle updates. There are, however, other problems associated with grouping in datagrids. Expanding or collapsing a group causes the datagrid's CurrentItem to be NULL which seems to break the bindings for any comboboxes bound to lookups on the same DataContext. If anyone has a solution or at least advice on how to re-bind the comboboxes that would be appreciated; in the interim I have abandoned the use of grouping.

A: 

You can't do it directly. Use a view and handle update explicitly. Grouping breaks combobox lookups so if you have those abandon hope of grouping.

Peter Wone