ComponentOne Data Source for Entity Framework
Design-Time Features / Server-Side Filtering
In This Topic
    Server-Side Filtering
    In This Topic

    We already mentioned that it is generally desirable to restrict the data returned from the server to the client, and we demonstrated how C1DataSource facilitates this with the use of the FilterDescriptor Collection Editor. Now we’ll demonstrate how to provide the end user with the means to achieve server-side filtering.

    The user will select a Product Category from a combo box, for example, although other GUI controls can be used, and that will load a DataGrid with new data from the server.

    To implement server-side filtering, follow these steps:

    1. Add a new form with a C1DataSource component to the project used in Simple Binding. You can make this form the project's start up form to save time when you run the project.
    2. Establish the C1DataSource as before, but this time define two view sources: Categories and Products. Click the Add button twice in the ViewSourceCollection. Enter Categories next to the EntityViewSourceProperties.EntitySetName property for the first member (0) and enter Products for the second member (1). For Products, we’ll define a filter as shown in the following picture: