Avatar of Dennis_T_Holm
Dennis_T_Holm
 asked on

ListBox ItemTemplate. TextBox and ComboBox dont react to width

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>

Open in new window

Microsoft Development

Avatar of undefined
Last Comment
Dennis_T_Holm

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Dennis_T_Holm

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck