代码改一下
If e.Col.Name = "第一列" Then
e.StartDraw()
Dim fnt As New Font("微软雅黑",10,FontStyle.Bold)
If e.Row.DataRow.GetChildRows("表B").Count > 0 Then
Dim msg As String = CStr(e.Row.DataRow.GetChildRows("表B").Count)
Dim c As Integer
If e.Col.Width = -1 Then
c = 100
Else
c = e.Col.Width
End If
e.Graphics.FillEllipse(Brushes.red,e.x + c - 25 ,e.y+0,18,18)
' e.Graphics.FillEllipse(Brushes.red,e.x + 0 ,e.y + 0,18,18)
e.Graphics.DrawString(msg,fnt,Brushes.White,e.x + c - 22 ,e.y + 0)
End If
e.EndDraw()
End If