2016-06-17 4 views
1

ユーザーがリストから選択できるようにするにはコンボボックスがありますが、リストが長くなると自動的にラップアラウンドします。たとえば、ユーザーが十分に下にスクロールすると、リストの最後に到達し、1つの空の行の直後にリストの先頭が検索されます。ドロップダウン選択リストは決して本当に終わりません。ただループを永遠に保ちます。ComboBoxループスクロールをオフにする

ユーザーがリストの最後に到達するようにこのループ機能を削除するにはどうすればよいですか?

私のコード:この記事から

<ComboBox Name="listSelect" ItemsSource="{Binding DataInstance.ItemList}"> 
    <ComboBox.ItemTemplate> 
     <DataTemplate> 
      <TextBlock Text="{Binding ItemNumber, Mode=OneWay}" /> 
     </DataTemplate> 
    </ComboBox.ItemTemplate> 
</ComboBox> 
+0

それはあなたのために働いたのですか? –

答えて

1

考えられる解決策:http://netitude.bc3tech.net/2013/04/12/windows-8s-combobox-and-the-carouselpanel/

あなたのComboBoxコントロールに設定し、これがデフォルトのパネル上書きする必要があります。

<ComboBox.ItemsPanel> 
       <ItemsPanelTemplate> 
        <StackPanel Orientation="Vertical" /> 
       </ItemsPanelTemplate> 
</ComboBox.ItemsPanel> 

をこれは編集することですパネルテンプレートですので、最終的なコードは次のようになります:

<ComboBox Name="listSelect" ItemsSource="{Binding DataInstance.ItemList}"> 
    <ComboBox.ItemTemplate> 
     <DataTemplate> 
      <TextBlock Text="{Binding ItemNumber, Mode=OneWay}" /> 
     </DataTemplate> 
    </ComboBox.ItemTemplate> 
    <ComboBox.ItemsPanel> 
        <ItemsPanelTemplate> 
         <StackPanel Orientation="Vertical" /> 
        </ItemsPanelTemplate> 
    </ComboBox.ItemsPanel> 
</ComboBox> 
+0

はどこに入れますか? –

+0

素晴らしい!ありがとうございました :) –

関連する問題