我有一个gridview,我将它的一些列分组..
这是我对它们进行分组的方式:
void gvDetailsDefinition()
{
ColumnGroupsViewDefinition view = new ColumnGroupsViewDefinition();
view.ColumnGroups.Add(new GridViewColumnGroup());
view.ColumnGroups[0].Rows.Add(new GridViewColumnGroupRow());
view.ColumnGroups[0].Rows[0].Columns.Add(gvSalesForecastDetails.Columns["ItemCode"]);
view.ColumnGroups[0].Rows[0].Columns.Add(gvSalesForecastDetails.Columns["ItemDescription"]);
view.ColumnGroups[0].Rows[0].Columns.Add(gvSalesForecastDetails.Columns["MeasurementUnitSelection"]);
view.ColumnGroups.Add(new GridViewColumnGroup("January"));
view.ColumnGroups[1].Rows.Add(new GridViewColumnGroupRow());
view.ColumnGroups[1].Rows[0].Columns.Add(gvSalesForecastDetails.Columns["JanuaryQuantity"]);
view.ColumnGroups[1].Rows[0].Columns.Add(gvSalesForecastDetails.Columns["JanuaryVolume"]);
view.ColumnGroups.Add(new GridViewColumnGroup("February"));
view.ColumnGroups[2].Rows.Add(new GridViewColumnGroupRow());
view.ColumnGroups[2].Rows[0].Columns.Add(gvSalesForecastDetails.Columns["FebruaryQuantity"]);
view.ColumnGroups[2].Rows[0].Columns.Add(gvSalesForecastDetails.Columns["FebruaryVolume"]);
gvSalesForecastDetails.ViewDefinition = view;
}
我可以改变Font size and weight
吗ColumnGroup
?
这是它的结果: