ComboBox Width
-
Hi, Is there any simple way (without code) of setting the ComboBox width to be as it's wider item? Thanks, Yanai
You can databind it to the width of its widest item using the databinding dialogues in expression blend (assuming that's what you are using). However, it should be able to do that automatically. Make sure that the space you have it in can allow the combobox to be as wide as it should be; then make sure the combobox has its height and width set to auto. Finally, check to see that the widest item can fit in the space alloted to the combobox. Let me know if that helps.
-
You can databind it to the width of its widest item using the databinding dialogues in expression blend (assuming that's what you are using). However, it should be able to do that automatically. Make sure that the space you have it in can allow the combobox to be as wide as it should be; then make sure the combobox has its height and width set to auto. Finally, check to see that the widest item can fit in the space alloted to the combobox. Let me know if that helps.
Thanks for the help. unfortunatley i think it won't work for me. The data binding thing i can do only if i know in advanced which items will be in the combo box. what if i bind it to a list of strings? about the automatic thing. it didn't work. i have enough room in a grid's auto size column. the combo box just change it's width every time i choose something from the list to fit the minimum width required (by controls on the same column) any solution for that? Thanks, Yanai