DataGridView CellPainting Not Fully Working on Scroll
First post, but long time browser :)

So here's my problem:  Basically I have a datagridview that I am using to interact with the user.  In all of the rows, there is an "info" button that will give the illusion that it adds another row below it with all of the cells merged (one long cell across entire row) and draws the text and images describing the row above it onto the "info cell".  

This works great except when the datagridview is scrolled vertically, then it appears that the painting isn't called and the grid is messed up looking.  Any ideas?

Here is a basic outline of the code:

    private void grid_CellPainting(object sender, DataGridViewCellPaintingEventArgs e){     
        // Loop through and draw all of the open information rows
        foreach (int i in openInfoCells) {
            if (i >= grid.FirstDisplayedCell.RowIndex && 
                i <= (grid.DisplayedRowCount(true) + grid.FirstDisplayedCell.RowIndex)) {
                
                // Draw Rectangle
                ....

                // Draw Text or Image
                ....
            }
        }
    }


DataGridView CellPainting Not Fully Working on Scroll
===

First post, but long time browser :)

So here's my problem:  Basically I have a datagridview that I am using to interact with the user.  In all of the rows, there is an "info" button that will give the illusion that it adds another row below it with all of the cells merged (one long cell across entire row) and draws the text and images describing the row above it onto the "info cell".  

This works great except when the datagridview is scrolled vertically, then it appears that the painting isn't called and the grid is messed up looking.  Any ideas?

Here is a basic outline of the code:

    private void grid_CellPainting(object sender, DataGridViewCellPaintingEventArgs e){     
        // Loop through and draw all of the open information rows
        foreach (int i in openInfoCells) {
            if (i >= grid.FirstDisplayedCell.RowIndex && 
                i <= (grid.DisplayedRowCount(true) + grid.FirstDisplayedCell.RowIndex)) {
                
                // Draw Rectangle
                ....

                // Draw Text or Image
                ....
            }
        }
    }

