2
我想根据所做的计算更改整行的背景颜色。更改DevExpress PivotGrid的ROW背景颜色
我在CustomAppearance或CustomDrawCell事件中遇到的问题是它遍历每个单元格并进行计算。我想根本改变列索引0行的颜色,因此不通过大数据集不必循环:
private void pvtGrdCtrlSummaryGrid_CustomDrawCell(object sender, PivotCustomDrawCellEventArgs e)
{
if (e.RowValueType == PivotGridValueType.Value && e.ColumnValueType == PivotGridValueType.GrandTotal && e.ColumnIndex == 0)
{
//Calculations made
//Change the entire row color here
}
}
所以我可以改变每个人的细胞和它的作品如预期,但滚动时显得十分缓慢并且不会顺利滚动。
我在C#WinForms应用程序中使用了pivotgridcontrol。
谢谢你,我能够对第一个单元格进行计算,然后在循环其余行的同时存储该值。 –