FlexGrid for WPF | ComponentOne
FlexGrid Samples / Financial Sample / Searching and Filtering
In This Topic
    Searching and Filtering
    In This Topic

    Much like iTunes users, financial analysts are probably not interested in looking at all of the records all of the time, so we need some filter or search mechanism.

    A real application allows the analyst to pick specific sets of papers to look at, and probably to save these views and switch between them. Our sample takes a simpler approach by re-using the SearchBox control described in the iTunes Sample. Instead of selecting specific entries, our users type something like “bank” or “electric” in the search box to filter the data.

    Hook up the SearchBox control to the financial data source with code like this:

    Copy Code
    // create data source
    FinancialDataList list = FinancialData.GetFinancialData();
    var view = new PagedCollectionView(list);
    // bind data source to the grid
    _flexFinancial.ItemsSource = view;
    // hook up the SearchBox (user can search by company name or symbol)
    _srchBox.View = view;
    var props = _srchCompanies.FilterProperties;
    See Also