I have wizard control with a gridview control, within a gridview I have dropdownlist and label control as a template column. I want to check any duplicate values in the dropdownlist, if found, show an error message and don't want to move to the next step in the wizard control. So far I stored the values in an array and check for duplicate entries and I don't know how to disable the postback on the next button in the wizard control
In rowdatabound event
foreach (GridViewRow row in GridView1.Rows)
{
string s = string.Empty;
if ((row.FindControl("LCSCD") as Label).Text != "FL")
{
if (((DropDownList)row.FindControl("DSBCD")).Visible == false)
{
s = ((Label)row.FindControl("LSBCD")).Text.ToString().Substring(0, ((Label)row.FindControl("LSBCD")).Text.ToString().IndexOf(" "));
sarray.Add(s);
}
else
{
s = ((DropDownList)row.FindControl("DSBCD")).SelectedItem.Value;
sarray.Add(s);
}
}
if (sarray.Distinct().Count() != sarray.Count())
{
}
else
{
}
please help me in this regard thanks