开发者

How to add sequence numbers to row headers

开发者 https://www.devze.com 2023-01-31 22:24 出处:网络
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

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();
}
0

精彩评论

暂无评论...
验证码 换一张
取 消