Question

Note before I begin.. this is what the customer wants it to look like, so if anyone has any "that's terrible UI/Style/looks/etc", I may or may not agree, but this is what they want. Opinions appreciated, but this is their request. :)

I've got a DataGridView that I've applied the SingleVertical CellBorderStyle to. I'm trying to get the vertical column separator lines to go all the way down to the end of the control, instead of ending at the last cell. Is there a way to do this without having to override OnPaint or something similar?

No correct solution

OTHER TIPS

Since you already have SingleVertical CellBorderStyle, you could fill the remaining space with one big blank final row:

//calculate the space already filled by column headers and rows
int currentContentHeight = Grid.ColumnHeadersHeight;
for (int i = 0; i < Grid.Rows.Count; i++)
{
    currentContentHeight += Grid.Rows[i].Height;
}
//then calculate the space remaining
int remainingHeightToEndOfControl = Grid.Height - currentContentHeight;
//then fill it with one big blank final row:
if (remainingHeightToEndOfControl > 0)
{
    Grid.Rows.Add();
    Grid.Rows[Grid.Rows.Count - 1].Height = remainingHeightToEndOfControl;
}

You may have to deduct 2 points or so from the remainingHeight to account for control borders.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top