行号显示------------------------------
Private Sub GridView1_CustomDrawRowIndicator(sender As Object, e As RowIndicatorCustomDrawEventArgs) Handles GridView1.CustomDrawRowIndicator
'行号
If e.Info.IsRowIndicator And e.RowHandle >= 0 Then
e.Info.DisplayText = e.RowHandle + 1
End If
End Sub
判断NULL------------------------------
判断在数据库中取出的字段是否是 NULL 用 ISDBNULL
如:If IsDBNull(objData) Then
判断一个对象是否存在,是否被初始化用 Nothing
如:If dsData Is Nothing Then
------------------------------------------
自动调整所有字段宽度: gridView1.BestFitColumns()
调整某列字段宽度: gridView1.Columns[n].BestFit()