您可使用<代码>RowBoundData,并根据您的某种条件设置茶叶。
Protected Sub GridView_RowDataBound(sender As Object, e As GridViewRowEventArgs)
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.Visible = True base on some condition
End If
End Sub
Another Method is to filter your Data. pass the filter expression in the below function and it will return you the desired output. You can do this before your binding.
Public NotInheritable Class GetFilteredData
Private Sub New()
End Sub
<System.Runtime.CompilerServices.Extension> _
Public Shared Function FilterDataTable(Dt As DataTable, FilterExpression As String) As DataTable
Using Dv As New DataView(Dt)
Dv.RowFilter = FilterExpression
Return Dv.ToTable()
End Using
End Function
End Class