Creating Custom Blocks
RadAutoCompleteBox allows not only appearance customization via the formatting event, but also replacement of the default UI block representation. The CreateTextBlock event exposes this possibility.
You should create a custom text block that inherits from ITextBlock and any inheritor of RadElement. Let’s extend the default TokenizedTextBlockElement by adding a check box. You don’t need to implement the ITextBlock interface, because it is already defined in the base class:
Then you should replace the default text block in the CreateTextBlock event handler, in the following manner:
Finally, the text property should be set:
The subscription to the event, should be introduced before setting the text of the control.
The following image demonstrates the final result: