I'm displaying a GridView with information from a database. I have a search option with a DropDownList with the options filter by defects or all.
<td>Filter By:</td>
<td>
<asp:DropDownList runat="server" ID="ddlServiceType">
<asp:ListItem Text="Defect Only" Value="DefectOnly" ></asp:ListItem>
<asp:ListItem Text="All" Value="All" ></asp:ListItem>
</asp:DropDownList>
</td>
If the defects option is selected then it should only display the records where defect is equal to true. Getting the value from the DropDownList:
string DefectField = ddlServiceType.SelectedValue;
string[] SearchDefectField = null;
if (DefectField != "null")
{
SearchDefectField = new string[] { DefectField };
}
I have most of the code I just don't know what to put in the if statement so when ...
Go to the complete details ...