我可以更改 VGridControl 中所有记录的颜色。
vGridControl1.Appearance.ReadOnlyRecordValue.ForeColor
但我不知道如何只改变一排的颜色。
EditorRow row = new EditorRow(id);
row.Name = "row" + id;
row.Properties.Row.Appearance.ForeColor = ColorText;
row.Properties.Row.Appearance.Options.UseForeColor = true;
我试着做点什么。但它是行不通的。请帮帮我。
好吧,如果我使用事件 CustomDrawRowHeaderCell,我可以更改标题的颜色。代码:
private void vGridControl1_CustomDrawRowHeaderCell(object sender, DevExpress.XtraVerticalGrid.Events.CustomDrawRowHeaderCellEventArgs e)
{
try {
System.Drawing.Color ColorText = Color.FromArgb(m_Color.r, m_Color.g, m_Color.b);
e.Row.Appearance.ForeColor = ColorText;
}
catch (Exception ex)
{ }
}
但是,当我尝试更改文本行颜色时,我遇到了问题:我无法更改文本行颜色。但我可以更改行背景颜色。谁能帮我?代码:
private void vGridControl1_CustomDrawRowValueCell(object sender, DevExpress.XtraVerticalGrid.Events.CustomDrawRowValueCellEventArgs e)
{
try
{
System.Drawing.Color ColorText = Color.FromArgb(m_Color.r, m_Color.g, m_Color.b);
e.Row.Appearance.ForeColor = ColorText;
e.Row.Appearance.Options.UseForeColor = true;
e.Row.Appearance.BackColor = ColorText;
}
catch (Exception ex)
{ }
}