Replace "value" element in QueryPanel's conditions — WinForms

EasyQuery library provides you with several different controls which are used in conditions in QueryPanel. Most of them represented by a kind of hyperlink which shows an additional control when you click on it. An example of such additional controls can be a simple edit box, a menu which contains the list of available values or a date/time picker element for date/time values. However, sometimes you would like to create your control and use it inside QueryPanel for some conditions. Here is a step-by-step description what you need to achieve this goal.

1. Creating an XElement descendant

First of all, you need to create your type of element. This element must be an instance of some class inherited from the XElement class. In our example, we will create a very simple element which can be used for boolean values and will just change it's value from “true” to “false” and vice versa when a user clicks on it.

2. Using new element in conditions

Second step - is actual using our new control inside QueryPanel's conditions. To replace the default XElement by our own you can use CreateValueElement event of QueryPanel controls. Here how it may look in our case: