This example creates a custom grid control with the CustomDrawGridLine
event that allows you to paint grid lines:
private void myGridView1_CustomDrawGridLine(object sender, CustomDrawLineEventArgs e) {
if(e.CellInfo != null)
e.Appearance.BackColor = e.CellInfo.RowHandle % 2 == 0 ? Color.BlueViolet : Color.DarkOrange;
else {
e.Cache.FillRectangle(Brushes.CadetBlue, e.Bounds);
e.Handled = true;
}
}
- CustomDrawLineEventArgs.cs (VB: CustomDrawLineEventArgs.vb)
- Main.cs (VB: Main.vb)
- MyGridControl.cs (VB: MyGridControl.vb)
- MyGridPainter.cs (VB: MyGridPainter.vb)
- MyGridRegistration.cs (VB: MyGridRegistration.vb)
- MyGridView.cs (VB: MyGridView.vb)
(you will be redirected to DevExpress.com to submit your response)