作者:Yomon-00 | 来源:互联网 | 2023-09-23 10:39
合并表头:
动态修改列头:
private void ReSetColumnHeader(GridPanel GP)
{
string year = System.DateTime.Now.Year.ToString();
string last = (System.DateTime.Now.Year -1).ToString();
this.GPSales.ColumnModel.SetColumnHeader(2, last);
this.GPSales.ColumnModel.SetColumnHeader(3, year);
this.GPSales.ColumnModel.SetColumnHeader(4, last);
this.GPSales.ColumnModel.SetColumnHeader(5, year);
this.GPSales.ColumnModel.SetColumnHeader(6, last);
this.GPSales.ColumnModel.SetColumnHeader(7, year);
this.GPSales.ColumnModel.SetColumnHeader(8, last);
this.GPSales.ColumnModel.SetColumnHeader(9, year);
this.GPSales.ColumnModel.SetColumnHeader(10, last);
this.GPSales.ColumnModel.SetColumnHeader(11, year);
this.GPSales.ColumnModel.SetColumnHeader(12, last);
this.GPSales.ColumnModel.SetColumnHeader(13, year);
this.GPSales.ColumnModel.SetColumnHeader(14, last);
this.GPSales.ColumnModel.SetColumnHeader(15, year);
this.GPSales.ColumnModel.SetColumnHeader(16, last);
this.GPSales.ColumnModel.SetColumnHeader(17, year);
this.GPSales.ColumnModel.SetColumnHeader(18, last);
this.GPSales.ColumnModel.SetColumnHeader(19, year);
this.GPSales.ColumnModel.SetColumnHeader(20, last);
this.GPSales.ColumnModel.SetColumnHeader(21, year);
this.GPSales.ColumnModel.SetColumnHeader(22, last);
this.GPSales.ColumnModel.SetColumnHeader(23, year);
this.GPSales.ColumnModel.SetColumnHeader(24, last);
this.GPSales.ColumnModel.SetColumnHeader(25, year);
}
效果: