ComponentOne Expression Editor for WPF
Working with Expression Editor / Integration with MSDataGrid
In This Topic
    Integration with MSDataGrid
    In This Topic

    Expression Editor, when integrated with grid, enables using expressions on grid and perform operations such as filtering, grouping, sorting, and column calculation over its data. To integrate Expression Editor with MSDataGrid, you need to use ItemsSource property of MSDataGrid that gets a collection of objects to generate grid data. Once the grid is populated, data source of Expression editor can be bound to data source of MSDataGrid using the DataSource property of C1ExpressionEditor class.

    The following image exhibits Expression Editor integrated with MSDataGrid control. The grid shows feature and cost information for different hardware products.

    The following code demonstrates integrating MSDataGrid with Expression Editor.

    Bind the instance of C1CollectionView component of MSDataGrid to Expression Editor through its DataSource property, as shown in the following code snippet.        

    ICollectionView View;
    public MainWindow()
    {
        InitializeComponent();
    
        CollectionViewSource view = new CollectionViewSource() { Source = Product.GetData(200) };
        View = view.View;
        msGrid.ItemsSource = View;
        FlexExpEditor.editor.FlexExpressionEditor.DataSource = View.CurrentItem;            
    }
    
    For the detailed data refer the sample project ExpressionEditorSamples accompanying the installer.

    Back to Top