I want to display items complete text in specified width. But if set width ComboBoxTool1.ValueList.DropDownListWidth= 100, complete text is not displayed and i want to show complete item text in specified width (height should be increased/decreased according to length of item text).
0
Hi Wagas,
Thank you for contacting Infragistics Developer Support.
I am not completely sure what your requirement is. Do you want to have ComboBoxTool with fixed width and if the items text doesn’t fit to show it on multiple lines? If that is the case, you can add new lines to the text as you need in order to show the text on a few lines.
Please let me know if you have any additional questions or if I have misunderstood your question.
Yes this is exactly what i want, if the items text doesn’t fit to show in expanded valuelist , show it on multiple lines, how can i do this? can you please provide piece of code?
Thank you for the reply.
What you could do in order to implement such feature is to use an UltraCombo and add it to the ToolbarsManager using ControlContainerTool. You can easily make an UltraCombo look like ComboBoxTool and it allows you greater flexibility in resizing its rows. You can set the combo to be multiline and RowSizing to Free and if the row has enough height it will wrap the text of its cells. In order to ensure that it has enough space you should handle the BeforeDropDown event, iterate the combo rows and use the MeasureString method of the Graphics class in order to determine how many times you need to increase the row’s height.
I have attached a sample which demonstrates this approach.
Please let me know if you have any additional questions.