I want to add autogenerated numbers to the row headers. I am wonder开发者_JAVA百科ing if this is doable by using WPF datagrid?
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();
}
精彩评论