I\'m trying to mimic what every other tabular view does with the DataGridView control, but I can\'t seem to get the headers correct.
I want a blank header to the right o
After adding all your columns, you can add an extra column, set the following properties to:
AutoSizeMode = Fill;
HeaderText = ""
ReadOnly = true;
SortMode = NotSortable;
, handle the gridView CellPainting event
for this particular column by preventing the borders from being painted:
private void dataGridView1_CellPainting(object sender,
DataGridViewCellPaintingEventArgs e)
{
if (e.RowIndex > -1 && e.ColumnIndex == dataGridView1.Columns.Count - 1)
{
e.AdvancedBorderStyle.All = DataGridViewAdvancedCellBorderStyle.None;
e.PaintBackground(e.ClipBounds, false);
e.Handled = true;
}
}
and you'll get what you want.