Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
34510
Size multi-column comboeditor dropdown to show all columns
posted

"In the XamMultiColumnComboEditor, I want to stop the dropdown from resizing past the last column in the grid.  I also want the dropdown to initially display the full width of the grid."

The XamMultiColumnComboEditor uses a Popup control for the drop down so you need to use this to find the column CellControls which will give you the widths you need.  The only problem is that using the combo editor's DropDownOpened event won't give you the widths on the first try because the Columns haven't been created yet.  This is where you need to handle the Popup's Opened event.  This event occurs after the columns are created so we'll use it to traverse down the VisualTree of the popup and look for the first row in the grid.  We then add up the widths of all the cells in that row and set the popup's width.  At the same time we should set the Popup's MaxWidth to the same value so that resizing the dropdown won't let you go past the last column.

I've attached a sample that demonstrates the above method.

xamMultiColumnCombo.zip
Parents Reply Children