摘要:
来源:http://www.cnblogs.com/Laro/archive/2011/04/04/2005490.html将datagrid加入序号的方法,在事件中加入如下代码:dataGrid.LoadingRow +=new EventHandler<DataGridRowEventArgs>(dataGrid_LoadingRow);关键代码//添加行号publicvoid dataGrid_LoadingRow(object sender, DataGridRowEventArgs e){e.Row.Header = e.Row.GetIndex() +1;} 阅读全文