转载:http://www.cnblogs.com/GarfieldTom/archive/2012/07/31/2617337.html
cxGrid失去焦点后如何继续保持选中单元的高亮状态,找了好久才找到一个答案:
Solution
There is no need to adjust those options. The solution is very simple: You should define a new style (an Item of the Style Controller) which defines the necessary colors for highlighting and use it both for the View's Styles.Inactive and Styles.Selection properties.
NOTE: Make sure to set the View's OptionsSelection.HideSelection option to False. Otherwise, the selection highlighting will be hidden when the Grid is inactive.
在界面在放一个TcxStyleRepository控件,在控件中添加一个TcxStyle样式,设置Color为clHightlight,TextColor 设置为(255,255,255)白色;
将TcxGridDBTableView的Styles下Inactive与Selection的属性设置为:TcxStyle样式。
本文介绍了一种方法,使cxGrid在失去焦点后仍能保持选中单元格的高亮显示。通过定义一个新的样式并应用到cxGrid的Inactive和Selection属性上,可以实现这一效果。此外,还需确保OptionsSelection.HideSelection选项被设置为False。
3214

被折叠的 条评论
为什么被折叠?



