【问题标题】:How to set the back color of the header in a radGridView如何在 radGridView 中设置标题的背景颜色
【发布时间】:2013-10-06 13:13:45
【问题描述】:

我想在radGridView中更改标题的背面颜色。除了使用主题之外,还有其他方法可以更改吗?(winform)

【问题讨论】:

  • 欢迎来到 Stackoverflow。在你问这里之前,请先努力。您可以阅读FAQHow to Ask 作为开始..

标签: c# winforms telerik-grid radgridview


【解决方案1】:
private void radGridView1_ViewCellFormatting(object sender, CellFormattingEventArgs e)
{
    if (e.CellElement is GridHeaderCellElement)
    {
        if (e.CellElement.Text == "Your header cell text") //checking for the text in header cell
        {
            e.CellElement.DrawBorder = true;
            e.CellElement.DrawFill = true;
            e.CellElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
            e.CellElement.BackColor = Color.Green;
            e.CellElement.ForeColor = Color.Red;
        }
    }
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-05-02
    • 1970-01-01
    • 2021-05-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多