我正在使用PivotGrid(DevExpress)。我想在for循環中設置AppearancePrint屬性設置。動態設置屬性值
在下面的例子中,我如何在Cell中使用變量類型?
所以不是
grid.AppearancePrint.Cell.BackColor = Color.White;
grid.AppearancePrint.Cell.BackColor2 = Color.LightBlue;
我想這樣做:
//datarow example <PrintAppearance Type="Cell" Font="Tahoma,8,Regular" BackColor="White" BackColor2="Light Grey"/>
foreach (DataRow dr in appearances)
{
string type = dr["Type"].ToString();
grid.AppearancePrint.[type].BackColor = Color.FromName(dr["BackColor"].ToString());
grid.AppearancePrint.[type].BackColor2 = Color.FromName(dr["BackColor2"].ToString());
}
謝謝。它做到了。 – 2010-08-24 20:01:59