troubleshooting Question

ListBox ItemTemplate. TextBox and ComboBox dont react to width

Avatar of Dennis_T_Holm
Dennis_T_Holm asked on
Microsoft Development
1 Comment1 Solution825 ViewsLast Modified:
I want to display Some labels, textbox and combobox in a ListBox. Therefore i have created an ItemTemplate which describes how each item is to be presented. Problem is that im not able to set the width of my textbox and combobox. they just dont react when setting the width property... I have tried putting my labels, combobox and textbox into a grid, stackpanel, etc. But im just not able to make this work....


<ListBox ItemsSource="{Binding Routes}">
   <ListBox.ItemTemplate>
       <StackPanel Orientation="Horizontal" VerticalAlignment="left">
         <TextBox VerticalAlignment="left" Width="60" Text="{Binding Width}" />
         <TextBox VerticalAlignment="left" Width="100" Text="{Binding Name}"/>
         <ComboBox VerticalAlignment="left" Width="40" ItemsSource="{Binding Color}"/>
       </StackPanel>
   </ListBox.ItemTemplate>
 </ListBox>
ASKER CERTIFIED SOLUTION
Dennis_T_Holm

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 1 Comment.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros