c# - When using DataGrid, how to bind DataGridComboBoxColumn to other column contents -
i have datagrid, itemssource binding observablecollection. and:
- the 1st column binding name property;
- the 2nd column binding age property;
now want add 3rd column, using datagridcomboboxcolumn control. , it's content shall names of column 1. when adding or removing row, content of datagridcomboboxcolumn shall add or remove name correspondingly.
the way thought out silly: create new observablecollection called namelist. , everytime adding or removing row datagrid, add or remove name namelist @ same time.
is there better way?
add new property has getter , bind visibility property of first column.
do not forget execute onpropertychanged added property when value of third column modified.
Comments
Post a Comment