Active Query Builder 2 .NET Edition reference
CustomExpressionBuilder Event
Example 



Is called to edit SQL expression of the Expression or Criteria column cell of the Query Columns Grid when the user clicks the ellipsis button.
Syntax
'Declaration
 
Public Event CustomExpressionBuilder As CustomExpressionBuilderEventHandler
'Usage
 
Dim instance As QueryBuilder
Dim handler As CustomExpressionBuilderEventHandler
 
AddHandler instance.CustomExpressionBuilder, handler
public event CustomExpressionBuilderEventHandler CustomExpressionBuilder
public: __event CustomExpressionBuilderEventHandler* CustomExpressionBuilder
Remarks

A dialog is expected to be shown in this event handler to edit the expression string passed in the expression parameter. The queryColumnListItem parameter refers to the item of QueryColumnsList object being edited.

The conditionIndex parameter equals to -1 if called to edit the Expression column value (criteriaItem.ExpressionString) and is greater than -1 to refer to the Criteria column being edited (queryColumnListItem.ConditionStrings[conditionIndex])

The ellipsis button is shown only when the UseCustomExpressionBuilder property is set to true.

Example
private void queryBuilder1_CustomExpressionBuilder(QueryBuilder queryBuilder, QueryColumnListItem queryColumnListItem, int conditionIndex, string expression)
{
    using (CustomExpressionEditor f = new CustomExpressionEditor())
    {
        f.tbSearchText.Text = expression;
 
        if (f.ShowDialog() == DialogResult.OK)
        {
            // Update the query column list with new expression text.
 
            if (conditionIndex > -1) // it's one of condition columns
            {
                queryColumnListItem.ConditionStrings[conditionIndex] = f.tbSearchText.Text;
            }
            else // it's the Expression column
            {
                queryColumnListItem.ExpressionString = f.tbSearchText.Text;
            }
        }
    }
}
See Also

Reference

QueryBuilder Class
QueryBuilder Members

 

 


© Copyright 2005-2012 ActiveDBSoft. All rights reserved.

Send Feedback