locked
Limit data returned in Filter(s) RRS feed

  • Question

  • User-1865006578 posted

    Hi,

    This query is perhaps more related to LinQ, but perhaps someone working with dynamic data has had a similar scenario.
    In short I need to know how to limit the data returned in filters with a "where clause".

    Scenario:
    I am using the default filter on top of my page to display a list of Manufacturers.
    ....
    [Filter(FilterControl = "Default")]
    [
    DisplayName("Manufacturer")]
    public object Manufacturers { get; set; }

    At the moment all manufacturers in the database table are returned in the filter.
    I need to be able to only return / display Manufacturers that are linked to the logged in Customer.
    I have the customer ID of the logged in customer (user) and just need to specify the value in the "where" clause before the data is returned.

    Question:
    In t-SQL it would be "Select * from Manufacturers where customer_ID = @Customer_ID".
    Unfortunately I am not sure how to do this with the default filter using Dynamic Data & LinQ, please can you assist. [:)]

    Regards
    Abrie

    Monday, August 11, 2008 8:50 AM

All replies

  • User-330204900 posted

    Have a look at the Integert Filter in the Dynamic Data Futures as this builds a query in the Page_Init which you could add a where clause to the query in place of the distinctCall if you get my meaning.

    Hope this helps [:D]

    Monday, August 11, 2008 9:26 AM