Reputation: 86085
I want to add autogenerated numbers to the row headers. I am wondering if this is doable by using WPF datagrid?
Upvotes: 2
Views: 367
Reputation: 84657
You can set them when a DataGridRow is loaded in the LoadingRow event
<DataGrid ...
LoadingRow="dataGrid_LoadingRow">
private void dataGrid_LoadingRow(object sender, DataGridRowEventArgs e)
{
e.Row.Header = (e.Row.GetIndex()).ToString();
}
Upvotes: 4