I have a custom derivative of a DataGridView
. I'm looking to change the positions where some rows will be drawn: starting from a certain index forward, I want to move each row below that row one row-height lower, so I can paint custom shapes in the resulting space between rows. What I thought of is overriding OnRowPrePaint
and checking whether the row index is greater than the threshold row. If it is, I want to move the row down:
private void MoveRows(DataGridViewRowPrePaintEventArgs e)
{
if(e.RowIndex >= thresholdRowIndex)
{
e.RowBounds.Y += e.RowBounds.Height; // doesn't work
}
}
And here's the problem. I thought I could move some kind of a bounding rectangle, but the only thing I see is RowBounds
and that's read-only.
What are my options here?