One way to do this is to use a derived columnstyle, override the Paint method and do the text drawing yourself, using whatever font or colors you like. If you add an event to your derived column style that is fired immediately before the text is drawn, and use the event args to get the font and color information, you can let the event handler completely determine the look of any cell.
DataGrid之设置任意单元格或任意行的各种属性
最新推荐文章于 2023-05-23 22:17:52 发布
博客介绍了自定义DataGrid单元格样式的方法,可通过派生列样式、重写Paint方法来自定义文本绘制,使用喜欢的字体和颜色。还可添加事件,在文本绘制前触发,利用事件参数获取字体和颜色信息,让事件处理程序决定单元格外观。
1182

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



