c#GridControl如何改变单元格的边框颜色
2018-09-25 11:45 梦幻沙漏 阅读(3480) 评论(0) 收藏 举报在事件CustomDrawCell中添加
e.Cache.DrawRectangle(new Pen(Color.Red, 2), e.Bounds);
就可改变单元格边框颜色。通过Pen的设置可以设置边框颜色和边框线的大小
下面是改变第一行第一列的单元格边框颜色
private void gridView1_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e)
{
int columnIndex = e.Column.AbsoluteIndex;
int rowIndex = e.RowHandle;
if (columnIndex==0&&rowIndex==0)
{
e.Cache.DrawRectangle(new Pen(Color.Red, 2), e.Bounds);
}
}
浙公网安备 33010602011771号