Reputation: 5078
I need to get the column count of a DataGrid in WPF. I can get the row count like this:
var rowCount = Grid.Items.Count;
but I need to get the number of columns.
Upvotes: 0
Views: 256
Reputation: 169420
Grid.Columns.Count should work if Grid is a DataGrid.
Grid.Columns.Count
Grid
DataGrid
Upvotes: 2