开发者论坛

 找回密码
 注册 (请使用非IE浏览器)
查看: 3771|回复: 7

gridview的行样式和格样式的设置

[复制链接]

0

精华

19

贡献

352

赞扬

帖子
142
软币
1717
在线时间
183 小时
注册时间
2016-9-10
发表于 2016-9-26 14:37:52 | 显示全部楼层 |阅读模式
private void gridView1_RowStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowStyleEventArgs e)
        {
            //GridView View = sender as GridView;
            //if (e.RowHandle >= 0)
            //{
            //    string category = View.GetRowCellDisplayText(e.RowHandle, View.Columns["clores"]);
            //    int i = Convert.ToInt32(category);
            //    if (i % 2 == 0)
            //    {
            //        e.Appearance.BackColor = Color.Salmon;
            //        e.Appearance.BackColor2 = Color.SeaShell;
            //    }
            //}     
        }
        private void gridView1_RowCellStyle(object sender, RowCellStyleEventArgs e)
        {
            GridView View = sender as GridView;
            if (e.Column.FieldName == "content")
            {
                string category = View.GetRowCellDisplayText(e.RowHandle, View.Columns["content"]);
            }
            if (e.Column.FieldName == "volumeWeight" || e.Column.FieldName == "weightes")
            {
                e.Appearance.ForeColor = Color.YellowGreen;
            }
            if (e.Column.FieldName == "fweight" || e.Column.FieldName == "cfweight")
                e.Appearance.ForeColor = Color.Coral;
            }
        }
回复

使用道具 举报

0

精华

2

贡献

138

赞扬

帖子
129
软币
1198
在线时间
136 小时
注册时间
2014-12-29
发表于 2016-9-26 20:16:15 | 显示全部楼层
学习学习学习
回复

使用道具 举报

0

精华

0

贡献

0

赞扬

帖子
4
软币
69
在线时间
1 小时
注册时间
2016-9-23
发表于 2016-9-27 09:35:20 | 显示全部楼层
学习学习学习
回复

使用道具 举报

0

精华

0

贡献

5

赞扬

帖子
4
软币
104
在线时间
4 小时
注册时间
2016-9-27
发表于 2016-9-27 14:50:00 | 显示全部楼层
学习一下。哈。

回复

使用道具 举报

0

精华

0

贡献

262

赞扬

帖子
184
软币
2037
在线时间
245 小时
注册时间
2014-4-22
发表于 2016-10-1 01:03:52 | 显示全部楼层
看看学习学习
回复

使用道具 举报

0

精华

0

贡献

92

赞扬

帖子
83
软币
982
在线时间
107 小时
注册时间
2017-3-20
发表于 2017-4-30 10:40:22 来自手机 | 显示全部楼层
谢谢楼主分享
回复

使用道具 举报

Archiver|手机版|小黑屋|开发者网 ( 苏ICP备08004430号-2 )
版权所有:南京韵文教育信息咨询有限公司

GMT+8, 2024-3-29 01:15

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表