Hi,
is there any way to display xamComboEditor items horizontally rather than vertically ? If it needs to be done by setting some property then Can any one tell me that property ?
Regards,
Mudit Singh
Hello Mudit,
In order to change the orientation of the items within the WPF XamComboEditor's dropdown, I can suggest you handle its DropDownOpened event and by manually getting the respective VirtualizingStackPanelEx element that holds the elements, you will be able to set its Orientation property to Horizontal.
Code-behind:
private void combo_DropDownOpened(object sender, RoutedEventArgs e){ this.Dispatcher.BeginInvoke(new Action(() => { var dropdownPopup = GetOpenPopups().FirstOrDefault().Child; if (dropdownPopup == null) return; var panel = Utilities.GetDescendantFromType(dropdownPopup, typeof(VirtualizingStackPanelEx), false) as VirtualizingStackPanelEx; if (panel == null) return; panel.Orientation = Orientation.Horizontal; }));}
var panel = Utilities.GetDescendantFromType(dropdownPopup, typeof(VirtualizingStackPanelEx), false) as VirtualizingStackPanelEx; if (panel == null) return; panel.Orientation = Orientation.Horizontal; }));}
I have attached a sample application that demonstrates the approach from above.
If you have any questions, please let me know.