Hi,
My ultracombo data source return long text.
But the ultracombo does not display them as a whole but truncated it due to the combobox width.
How can i autoresize the drop down based on value to be display?
Thanks.
Well, increasing the dropdown width each time depending on the length of the text may not look nice at all times on screen.
I would suggest to have tooltip to display complete text. Whenever user hovers over the items in teh combobox, the complete text for the same would be displayed on tooltip.
This can be done by writing the following code in the "InitializeRow" event of the Combo:
e.Row.Cells(ColumnName or Column Index).ToolTipText = e.Row.Cells(ColumnName or Column Index).Text.Trim()
Your solution will work, but it's a but over-complicated. I think this would be simpler:
this.ultraCombo1.DisplayLayout.Bands[0].PerformAutoResizeColumns(false, PerformAutoSizeType.AllRowsInBand);
My solution for this is: -
{
ultraCombo1.DisplayLayout.Bands[0].Columns[0].Width = ultraCombo1.DisplayLayout.Bands[0].Columns[0].CalculateAutoResizeWidth(Infragistics.Win.UltraWinGrid.
);