EasyQuery allows you to define custom value editor for some attribute and then create your UI to edit condition values for this attribute. Here are the step-by-step instructions:
- Run Data Model Editor (DME) and open your model file.
- Go to Entities tab and find necessary attribute.
- At the right panel for this attribute open “Value Editors” tab and select “Custom (user defined)” in “Default value editor” combo-box.
- Save your model and close DME.
- Open your project in Visual Studio and select QueryPanel component on form designer.
- Add an event handler for ValueRequest event (use Events tab in Properties panel).
Here is an example of ValueRequest event handler:
private void QPanel_ValueRequest(object sender, ValueRequestEventArgs e) {
//checking if this condition row is associated with some SimpleCondition object
if (((QueryPanel)sender).ActiveRow is QueryPanel.SimpleConditionRow) {
SimpleCondition cond = (SimpleCondition)e.Condition;
//if we need our entity attribute - we can get it from BaseAttr property of SimpleCondition object
EntityAttr attr = cond.BaseAttr;
//bring your own dialog to edit condition value
//you can use event parameter properties Value and Text to get current value
. . . . . . . .
//after the dialog is closed - return new value and (if necessary) text via event's parameter
e.Value = "<new value>";
e.Text = "<new text>"; //you can omit this
}
}