This example demonstrates how to create a tooltip for each ComboBox item. In the first pair of ASPxComboBoxes, items are read from the database and converted from plain text to HTML code (<span title=’Description’>CategoryName</span>). In the third ComboBox, its items are added at runtime using the ASPxComboBox.Items.Add method. Please note that it's necessary to use this method with 2 parameters: text and value separately, otherwise the HTML string will be used as a value of an7 item and will be sent to the server on a callback. In this case, ASP.NET environment automatically stops the execution of server-side operations and raises HttpRequestValidationException.
The “EncodeHtml” property of ASPxComboBox is set to “false” to guarantee that the HTML code is executed.
In the first and third methods, the HTML code is created on the server side in the “ASPxComboBox_Init” event.
In the second method, the HTML code is created by modifying the select command of the data source.