Skip to content

Create a custom Grid Control with the CustomDrawGridLine event.

License

Notifications You must be signed in to change notification settings

DevExpress-Examples/winforms-grid-custom-draw-grid-lines

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WinForms Data Grid - Custom draw grid lines

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;
    }
}

Files to Review

Documentation

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)