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;

example image

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

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -