如果DataGrid
为空,我想要一条消息,但此刻什么都没有,这是我的代码:
Private Sub fill_tbldespesas()
Dim ds As New DataSet
Dim BD_SimuladorNT As New Negocio.Simulador.SimulacoesNT
ds = BD_SimuladorNT.Fill_DGDespesas(CurrentContext.CurrentUserId, CurrentContext.CurrentCulture.idCulture)
Dim dv As DataView
If (Not (dv Is Nothing)) Then
If ds.Tables.Count > 0 Then
dv = ds.Tables(0).DefaultView
dv.RowFilter = "IncluidaProp = 'T'"
dgdespesas.DataSource = dv
dgdespesas.DataBind()
End If
If ds.Tables.Count < 1 Then
Dim lblempty As Label = DirectCast(FindControl("lblgridEmpty"), Label)
dgdespesas.DataSource = Nothing
Me.dgdespesas.ShowHeader = False
'gridEmpty.text = "Company Name must not be empty"
'dgdespesas.rows.clear()
lblempty.Text = "no results"
End If
End If
End Sub