Ibanez1408
Ibanez1408

Reputation: 5078

Get the datagrid column count in WPF

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

Answers (1)

mm8
mm8

Reputation: 169420

Grid.Columns.Count should work if Grid is a DataGrid.

Upvotes: 2

Related Questions