You don't need the Panel at all.
Create your own DGV class by inheriting from it, then override the OnPaint method with something like:
Public Class MyDGV
Inherits DataGridView
Protected Overrides Sub OnPaint(e As System.Windows.Forms.PaintEventArgs)
MyBase.OnPaint(e)
' Call your line painting code here...
End Sub
Private Sub MyLinePaintingCode()
Dim g As Graphics = Me.CreateGraphics
' Your painting logic goes here...
End Sub
End Class
Then you don't have to use a Panel control and worry about the messy details of Transparency in Windows Forms.
Your custom DGV will show up in the Toolbox. Use that one instead of the default DGV control and your done.