嗨,我有一个 radgrid,我必须在其上找到一个值,如果找到该项目,则生成消息
下面是我的代码
Protected Sub btnAdd_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnAdd.Click
If IsAlreadyExist() Then
ram.Alert("")
Else
If IsAlreadyAdded() Then
ram.Alert("")
Else
employees()
End If
End If
End Sub
这是 IsAlreadyAdded 方法,我在其中尝试在网格中查找特定值,如果存在,它将返回 false
Private Function IsAlreadyAdded() As Boolean
'If rgListnk.MasterTableView.Items.Count > 0 Then
Dim itm As GridDataItem = rgList.MasterTableView.FindItemByKeyValue("DEFAULT", "Y")
If IsNothing(itm) Then
Return False
Else
Return True
End If
End Function
谢谢...