ActiveDatabaseSoftware.ActiveQueryBuilder Namespace > QueryBuilder Class : CustomExpressionBuilder Event |
'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
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.
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; } } } }