Hello,
I'm hosting ListView in a DropDownEditorButton button. The dropdown button and the ListView should look and feel like a regular combobox. The dropdown button hosts the ListView and shows it as expected. My question is: how to determine the size of the ListView necessary and sufficient to show all items (there will be just a couple of them) without scrolling and elipsis?
Here is the code how I expect that to be done:listView.View = UltraListViewStyle.List;listView.ItemSettings.SelectionType = SelectionType.Single;listView.ViewSettingsList.ColumnWidth = -1;listView.Items.Add("Entry One", "Entry One");listView.Items.Add("The second entry", "The second entry");listView.Size = GetSufficientSize(listView); The part that is missing here is the GetSufficientSize method implementation.Thanks,Vitaly
The control does not publicly expose a way to determin the size required to show all items without a scrollbar. Note that a ComboBox actually does not do that either, it has a MaxDropDownItems property which determines how many items appear in the viewable area.
Alright, actually I'm okay with something similar to MaxDropDownItems. How to achieve that?And how to determine the required width? I skimmed through properties of the list view and haven't found that as well (except setting ColumnWidth to -1, but I actually need the width in pixels).
Thanks,Vitaly