Recently I have gone through a situation where there will be a ComboBox and it will have a list of data, some items will be too lengthy. And I have to show the width of Combo with the maximum size of the item in the dropdown list of Combo. First I thought I must iterate through through all the list items and get all the lenths and find the maximum length of the item. And then set that length to the comob. I search for samples with any simpler solution than the above, but all the people suggest the above process only.
Instead of doing the above process just remove the width property to the combo, instead provide minWidth (so that combo will show minimum width even there is no data). This solves my problem.