Expression Editor for WinForms | ComponentOne
Working with Expression Editor / Integration with FlexGrid / Column Calculation in FlexGrid
In This Topic
    Column Calculation in FlexGrid
    In This Topic

    Expression Editor, when integrated with grid, allows calculating column data for unbound columns of FlexGrid.

    To allow expressions to be used for generating data for unbound columns of FlexGrid, you can enable AllowExpressionEditing in the unbound column of FlexGrid and create the expression for the unbound column.

    The following image exhibits FlexGrid control, demonstrating column calculation using expressions.

    Column Calculation ExpressionEditor


    The following code demonstrates column calculation on FlexGrid columns through expressions.

    Column unboundcol = _flexGrid.Cols.Add();
    unboundcol.DataType = typeof(object);
    unboundcol.AllowEditing = false;
    unboundcol.Name = "CustomColumn";
    unboundcol.Caption = "Custom Column";
    unboundcol.AllowExpressionEditing = true;
    unboundcol.Expression = "[UnitsInStock] -[UnitsOnOrder]";
    

    Back to Top