开发者

How to add sequence numbers to row headers

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜