I am trying to validate duplicate value in the Radgrid cell , but it validates same raw itself please help me find the solution.
<
asp:CustomValidator
ID
=
"CustomValidator1"
runat
=
"server"
ErrorMessage
=
"Duplicate product not allowed"
ControlToValidate
=
"RadComboBox1"
OnServerValidate
=
"CustomValidator1_ServerValidate"
>
Protected
Sub
CustomValidator1_ServerValidate(
ByVal
source
As
Object
,
ByVal
args
As
System.Web.UI.WebControls.ServerValidateEventArgs)
For
Each
dataItem
As
GridDataItem
In
RadGrid1.Items
If
args.Value =
CType
(dataItem(
"pk_productid"
).FindControl(
"RadComboBox1"
), RadComboBox).Text
Then
args.IsValid =
False
End
If
Next
End
Sub