zoukankan      html  css  js  c++  java
  • GridView改变单行背景色

                DevExpress.XtraGrid.StyleFormatCondition StyleFormatCondition1 = new DevExpress.XtraGrid.StyleFormatCondition();
                StyleFormatCondition1.Appearance.BackColor = System.Drawing.Color.Red;
                StyleFormatCondition1.Appearance.BackColor2 = Color.White;
                StyleFormatCondition1.Appearance.Options.UseBackColor = true;
                //StyleFormatCondition1.ApplyToRow = true;
                StyleFormatCondition1.Column = MainView.Columns[0];
                StyleFormatCondition1.Condition = DevExpress.XtraGrid.FormatConditionEnum.Equal;
                StyleFormatCondition1.Value1 = "wyl2";
                MainView.FormatConditions.AddRange(new DevExpress.XtraGrid.StyleFormatCondition[] { StyleFormatCondition1 });

    也可以:

    在GridControl中的Gridview的CustomDrawCell写如下代码private void gridView1_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e)
            {
                    if (e.RowHandle==1)
                    {

                        //字体颜色,也可改变背景颜色等属性
                        e.Appearance.ForeColor = Color.Red;
                    }
                   if (e.RowHandle==3)
                    {

                        //字体颜色,也可改变背景颜色等属性
                        e.Appearance.ForeColor = Color.Red;
                    }

            } (其他DX控件都有此类似方法来改变属性)

    本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/david04310711323/archive/2008/07/21/2684144.aspx

  • 相关阅读:
    Spring-data-jpa和mybatis的比较及两者的优缺点?
    http和https的区别
    Springboot中spring-data-jpa实现拦截器
    RabbitMQ客户端页面认识
    设计模式之策略模式
    设计模式之策略模式应用实例(Spring Boot 如何干掉 if else)
    设计模式之装饰器模式
    网页跳转小程序
    好帖子
    git 回滚操作
  • 原文地址:https://www.cnblogs.com/djian/p/1901799.html
Copyright © 2011-2022 走看看