【发布时间】:2018-01-25 05:58:27
【问题描述】:
我有DataGridRow 和DataGrid,如何从中获取各个列的值?请参阅下面的代码。
var itemsSource = MESearchDatagrid.ItemsSource as IEnumerable;
if (itemsSource != null)
{
foreach (var item in itemsSource)
{
var row = MESearchDatagrid.ItemContainerGenerator.ContainerFromItem(item) as DataGridRow;
if (row != null)
{
//How to get the Cell value?
}
}
}
【问题讨论】:
-
我正在使用 WPF。
-
你也可以发布 XAML 吗?
标签: c# wpf wpfdatagrid