I have a class as follows
class DataGridItem
{
public bool IsSpecial;
public string Symbol;
public double Weight;
}
An editable datagrid is bound to a collection of objects of this class. What开发者_JS百科 I need to do is to bind several rows of the datagrid together. That is, whenever IsSpecial
is true
, the Weight
field of all rows must be the same. If I edit one row, it has to automatically modify all other rows where IsSpecial
is true
. How can I do this?
You can subscribe to the CellEditEnding/RowEditEnding and the InitializingNewItem events and change all the items in there. Remember to call the PropertyChanged handlers for every property changed so the grid does update!
精彩评论