开发者

WPF Binding rows of datagrid together

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!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜