我必须将Windows窗体控件转换为WPF。我想知道如何在WPF中迭代Datagrid。
For Each dr As DataGridViewRow In dtg.Rows
If dr.Cells("Name").Value.ToString.Trim <> String.Empty Then
row = dt.NewRow 'Create new row
For cn As Integer = 0 To TotalDatagridviewColumns
row.Item(cn) = IfNullObj(dr.Cells(cn).Value) ' This Will handle error datagridviewcell on NULL Values
Next
dt.Rows.Add(row)
End If
Next
我希望上面提到的在WPF DataGrid中工作。