行號顯示------------------------------數據庫
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 Subspa
判斷NULL------------------------------對象
判斷在數據庫中取出的字段是不是 NULL 用 ISDBNULLit
如:If IsDBNull(objData) Thengrid
判斷一個對象是否存在,是否被初始化用 Nothing數據
如:If dsData Is Nothing Thendi
------------------------------------------play
自動調整全部字段寬度: gridView1.BestFitColumns()
調整某列字段寬度: gridView1.Columns[n].BestFit()