tags:

views:

54

answers:

1

Hello,

I am binding a collection of MyItem class instances to a DataGrid. The MyItem class has a property called "IsSelected". This property can get changed programmatically. How do I propogate that change back to the UI such that if this value is true, the row associated with MyItem is highlighted (selected) and if it is false, the row associated with MyItem is not highlighted?

Thank you,

A: 

First make sure MyItem implements INotifyPropertyChanged and also use a ObservableCollection so your grid knows when the info has changed.

For the selection take a look at these blog they have a sample doing just what you want link text

alejandrobog