📜  datagridcheckboxcolumn 不包含 Checked 的定义 - 无论代码示例

📅  最后修改于: 2022-03-11 14:57:31.445000             🧑  作者: Mango

代码示例1
public IEnumerable GetDataGridRows(Microsoft.Windows.Controls.DataGrid grid)
{
    var itemsSource = grid.ItemsSource as IEnumerable;
    if (null == itemsSource) yield return null;
    foreach (var item in itemsSource)
    {
        var row = grid.ItemContainerGenerator.ContainerFromItem(item) as Microsoft.Windows.Controls.DataGridRow;
        if (null != row) yield return row;
    }
}