我使用FilterExpression进行了gridview以过滤gridview的内容。 要过滤这个,我使用多个DropDownList。因此,对于我的前3个下拉列表工作正常,但我的DropDownList的其余部分不起作用,我不知道为什么......
编辑:我认为这是我的SQL FilterExpression,它不起作用,但我不知道。这是我的代码SQLDatasource&过滤:
<asp:SqlDataSource ID="GridDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:connexionBase %>"
SelectCommand="SELECT [Nom], [Entite], [Origine], [ObjectifStrategique], [Cle], [MAP], [SNS], [Objectif operationnel], [Description activite], [Debut], [Fin], [Livrables] FROM reponse"
FilterExpression="Nom like '%{0}%' AND Entite like '%{1}%' AND Origine like '%{2}%' AND ObjectifStrategique like '%{3}%' AND Cle like '%{4}%' AND MAP like '%{5}%' AND SNS like '%{6}%'">
<FilterParameters>
<asp:ControlParameter Name="Nom" ControlID="NomPersonne" PropertyName="SelectedValue"
ConvertEmptyStringToNull="false" />
<asp:ControlParameter Name="Entite" ControlID="NomEntite" PropertyName="SelectedValue"
ConvertEmptyStringToNull="false" />
<asp:ControlParameter Name="Origine" ControlID="ContenuOrigine" PropertyName="SelectedValue"
ConvertEmptyStringToNull="false" />
<asp:ControlParameter Name="ObjectifStrategique" ControlID="Objectif_strategique"
PropertyName="SelectedValue" ConvertEmptyStringToNull="false" />
<asp:ControlParameter Name="Cle" ControlID="Key" PropertyName="SelectedValue" ConvertEmptyStringToNull="false" />
<asp:ControlParameter Name="MAP" ControlID="map1" PropertyName="SelectedValue" ConvertEmptyStringToNull="false" />
<asp:ControlParameter Name="SNS" ControlID="sns1" PropertyName="SelectedValue" ConvertEmptyStringToNull="false" />
</FilterParameters>
</asp:SqlDataSource>
我的DropDownList(不工作):
<asp:DropDownList ID="Objectif_strategique" runat="server" DataSourceID="SqlDataSourceStrategique"
DataTextField="contenuObjectif" CssClass="DropDownList" AppendDataBoundItems="true">
<asp:ListItem Text="" Value="" />
</asp:DropDownList>
<asp:DropDownList ID="sns1" runat="server">
<asp:ListItem Text="" Value="" />
<asp:ListItem Text="Oui" Value="Oui" />
<asp:ListItem Text="Non" Value="Non" />
</asp:DropDownList>
<asp:DropDownList ID="map1" runat="server">
<asp:ListItem Text="" Value="" />
<asp:ListItem Text="Oui" Value="Oui" />
<asp:ListItem Text="Non" Value="Non" />
</asp:DropDownList>
<asp:DropDownList ID="Key" runat="server">
<asp:ListItem></asp:ListItem>
<asp:ListItem>Oui</asp:ListItem>
<asp:ListItem>Non</asp:ListItem>
</asp:DropDownList>