困扰我好几天的一个问题、今天终于解决了.....................
GridControl的可以设置FocusedRow的前景色和背景色、但是由于前景色已经动态生成、所以不想被覆盖,英文大致为这样描述
by default the grid changes the cell's ForeColor when the row is focused and painted with a different background (AllowCellFocus turned off). How can I have the focused row still show the original ForeColors of all the cells in the row and
not overpaint it with a specific ForeColor for focused rows?
If I do that I can't highlight a focused row with a background color anymore. I want to still be able to change the background on row
focus but I want the fore colors to remain the same as in the unfocused cells.
大致就是:改变FocusedRow的背景色,但是不改变前景色
两步即可:
1、EnableAppearanceFocusedCell = False, EnableAppearanceFocusedRow = False
2、在代码里面给FocusedRow你想要的背景色、
private void gdvMarket_RowCellStyle(object sender, RowCellStyleEventArgs e)
{
if (e.RowHandle == gdvMarket.FocusedRowHandle)
{
e.Appearance.BackColor=Color.CadetBlue;
;
}
}
分享到:
相关推荐
在winform项目中,使用Devexpress GridControl控件,可能会遇到需要冻结头部几行的需求,本项目实例可以帮到你。
DevExpress GridControl控件使用DevExpress GridControl控件使用DevExpress GridControl控件使用DevExpress GridControl控件使用DevExpress GridControl控件使用
控制DevExpress中GridControl合并单元格方式
针对DevExpress GridControl GridView 新增行AddNewRow() 很多人加了代码也无法实现添加行或者添加行后InitNewRow这个事件没有触发, 其中主要原因见附件实例代码!
在CridControl中根据列表中的记录,根据不同的状态或者判断动态加载不同的图片,以达到不同的状态或者类别记录加载不同的图片,让效果更佳。
有时候需要在Gridcontrol中某一列添加一个小图片,以方便用户点击操作。这个例子是gridcontrol非图片列中添加小图片,进行相关的操作。
C# winform DevExpress 使用GridControl组件实现拖动排序功能,此文档中是完整Demo示例,原文参考 https://blog.csdn.net/xiaoid/article/details/95954708#commentBox 文献,加以修改并进行关键代码注释
解决DevExpress GridControl GridView 在新增数据行时数据为空的问题,新窗口数据返回时自动新增行并刷新。
DevExpress 编辑GridControl中合并单元格,要求版本号在15以上
简单纯C#代码控制表头合并和动态添加列。文件包里包含所需Devexpress的DLL文件,项目中引用就可以直接运行
devexpress表格控件gridcontrol实现对列统计,可实现总计,平均,求和等。
devexpress gridcontrol preview demo
devexpress表格控件gridcontrol实现纵向标头,在官网中找到一些案例整理给大家分享
devexpress的gridControl属性中文说明
DevExpress GridControl 控件内部行之间实现拖拽,实际拖拽后行移动过程未实现,可根据实际情况编写,适用GridControl在 winform或DockPanel、UserControl中
DevExpress中GridControl的属性设置
DevExpress中GridControl使用技巧总结-详解(图文并茂)
dev空间中GridControl自定义添加列以及不规则列头处理,涉及到列头分组问题
DevExpress GridControl,属性介绍,设置大全,很不错的
WPF DevExpress GridControl 实现点击行实现行的复选框跟随行的状态选中或取消, 1、行选中,复选框同时选中;行状态为取消,复选框状态也取消选中。 2、列表总取消默认第一行选中问题