0
点赞
收藏
分享

微信扫一扫

gridview 单元格为空时,加亮提示


 如果是objectDataSource

If e.Row.DataItem IsNot Nothing Then
Dim uservo As userVO = CType(e.Row.DataItem, userVO)
If uservo.Email.Equals("") Then
e.Row.Cells(3).BackColor = Color.Red
e.Row.Cells(3).Text = "空"
e.Row.Cells(3).ForeColor = Color.White
End If
End If

如果是sqlDataSource

If e.Row.DataItem IsNot Nothing Then
Dim drv As DataRowView = CType(e.Row.DataItem, DataRowView)
If drv("Email") Is System.DBNull.Value Then
e.Row.Cells(3).BackColor = Color.Red
e.Row.Cells(3).Text = "空"
e.Row.Cells(3).ForeColor = Color.White
End If
End If

举报

相关推荐

0 条评论