Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
15
WebDataGrid and FilterExpression not working
posted

I always get all rows from teh db  filter has no effect

<ig:WebDataGrid ID="gPayments"
runat="server"
Width="100%"
StyleSetName="Office2007Blue"
EnableAjax="False"
OnDataBinding="gPayments_DataBinding"
OnRowSelectionChanged="gPayments_RowSelectionChanged"
AutoGenerateColumns="False"
DataSourceID="sqlPayments">

<asp:SqlDataSource
ID="sqlPayments" runat="server"
ConnectionString="<%$ ConnectionStrings:HomeConnectionString %>"
FilterExpression="ID = {0}"
SelectCommand="SELECT ID, Rent, Housekeep FROM Leases">
<FilterParameters>
<asp:Parameter Name="ID" Type="Int32" />
</FilterParameters>
</asp:SqlDataSource>

at code behind

protected void gPayments_DataBinding(object sender, EventArgs e)
{
sqlPayments.FilterParameters["ID"].DefaultValue =Session["sqlPay"].ToString();
}

version

Infragistics45.Web.v18.2, Version=18.2.20182.192

Parents
No Data
Reply
  • 20
    Offline posted

    And what happens to the ID string - there are no restrictions on it, and setting its specific value gives something? Perhaps a mistake in this.

Children
No Data