C# Wpf ComboBoxColumn选定项到字符串列表

C# Wpf ComboBoxColumn选定项到字符串列表,c#,wpf,wpfdatagrid,C#,Wpf,Wpfdatagrid,问题:如何获取ComboBoxColumn中所有选定项的列表,以便更改数据库中的旧值 我是新加入wpf并溢出的,所以如果我假设0是ComboBoxColumn的索引,请原谅我犯了任何错误 int j = DataGD.Items.Count; int i = 0; do { DataGridRow row = this.DataGD.ItemContainerGenerator.ContainerFromIndex(i) as DataGridRow; ComboBox ele = this.D

问题:如何获取
ComboBoxColumn
中所有选定项的
列表
,以便更改数据库中的旧值
我是新加入wpf并溢出的,所以如果我假设0是ComboBoxColumn的索引,请原谅我犯了任何错误

int j = DataGD.Items.Count;
int i = 0;
do
{
DataGridRow row = this.DataGD.ItemContainerGenerator.ContainerFromIndex(i) as DataGridRow;
ComboBox ele = this.DataGD.Columns[0].GetCellContent(row) as ComboBox;
string newS = ele.Text;
list.add(newS);
i++;
} while (i < j);
int j=DataGD.Items.Count;
int i=0;
做
{
DataGridRow行=this.DataGD.ItemContainerGenerator.ContainerFromIndex(i)作为DataGridRow;
ComboBox ele=this.DataGD.Columns[0]。GetCellContent(行)作为ComboBox;
字符串newS=ele.Text;
添加(新闻);
i++;
}而(i
假设0是ComboBoxColumn的索引

int j = DataGD.Items.Count;
int i = 0;
do
{
DataGridRow row = this.DataGD.ItemContainerGenerator.ContainerFromIndex(i) as DataGridRow;
ComboBox ele = this.DataGD.Columns[0].GetCellContent(row) as ComboBox;
string newS = ele.Text;
list.add(newS);
i++;
} while (i < j);
int j=DataGD.Items.Count;
int i=0;
做
{
DataGridRow行=this.DataGD.ItemContainerGenerator.ContainerFromIndex(i)作为DataGridRow;
ComboBox ele=this.DataGD.Columns[0]。GetCellContent(行)作为ComboBox;
字符串newS=ele.Text;
添加(新闻);
i++;
}而(i
让我知道你做这件事面临的困难是什么?不知道如何做(任何帮助都会很好)这是我的程序的图片让我知道你做这件事面临的困难是什么?不知道如何做(任何帮助都会很好)这是我的程序的图片