Hi All,
I'm trying to do the following:
I have a datagridview with a fullrowselected selection mode, and I would like to change the full row border when selected, I've tried:
I'm trying to do the following:
I have a datagridview with a fullrowselected selection mode, and I would like to change the full row border when selected, I've tried:
Private
Sub DGCAL_CellPainting(ByVal sender AsObject, ByVal e As System.Windows.Forms.DataGridViewCellPaintingEventArgs) Handles DGCAL.CellPainting
If e.RowIndex = DGCAL.CurrentRow.Index Then
e.Paint(e.CellBounds, DataGridViewPaintParts.Border)
Using p = New Pen(Color.Black, 4)
Dim rect As Rectangle = e.CellBounds
rect.Width -= 2
rect.Height -= 2
e.Graphics.DrawRectangle(p, rect)
EndUsing
e.Handled = True
EndIf
EndSub
But I get borders in all cells inside the row insted of a single border all over the row, any suggestion would be eternally appreciated.
Thanks in advance