2011-12-16 5 views
0

누군가가 아래 항목 asssit 시겠어요 디스플레이 제어 제어하지 수직라디오 버튼 내가 수평으로 내 라디오 버튼을 필요로하는

<ItemsControl Name="rbQuestionAnswer" ItemsSource="{Binding Answers, Mode=TwoWay}" IsEnabled="{Binding IsEnabled, Mode=OneWay}" > 
    <ItemsControl.ItemTemplate > 
     <DataTemplate > 
      <RadioButton GroupName="{Binding SurveyLineID}" 
           Content="{Binding Answer}" 
           Tag="{Binding AnswerId}"    
           Style="{StaticResource RadioButtonStyle}" 
           IsChecked="{Binding IsSelected, Mode=OneWay}"    
           Checked="RadioButton_Checked" 
           Visibility="{Binding Path=IsRadio,Converter={StaticResource BoolConverter}}" > 
      </RadioButton> 
     </DataTemplate> 
    </ItemsControl.ItemTemplate> 
</ItemsControl> 

답변

0

할 항목 컨트롤 내에서 아래를 추가하는 데 필요한 :

<ItemsControl.ItemsPanel> 
     <ItemsPanelTemplate> 
     <StackPanel Orientation="Horizontal"/> 
     </ItemsPanelTemplate> 
</ItemsControl.ItemsPanel> 
1

당신이 할 <StackPanel/>를 사용할 수 있다고 생각합니다. 다음 코드를 시도해보십시오.

<ItemsControl ItemsSource="{Binding Options}"> 
      <ItemsPanelTemplate> 
       <StackPanel Orientation="Horizontal" /> 
      </ItemsPanelTemplate> 
      <ItemsControl.ItemTemplate> 
       <DataTemplate> 
        <RadioButton GroupName="{Binding AnswerId}" Content="{Binding Option}" IsChecked="{Binding IsSelected, Mode=OneWay}"/> 
       </DataTemplate> 
      </ItemsControl.ItemTemplate> 
</ItemsControl> 

는 요구 사항에 맞게 코드를 수정합니다. 희망, 그것은 당신을 도울 수 있습니다!

+0

이 시도하지만, 레이아웃은 여전히 ​​동일 – Bruie