xaml-sdk/ComboBox/DropDownWithHeaders/Example.xaml

46 строки
2.6 KiB
XML

<UserControl x:Class="DropDownWithHeaders.Example"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable="d"
DataContext="{StaticResource ViewModel}"
d:DesignHeight="300" d:DesignWidth="300">
<StackPanel>
<TextBlock Text="This example demonstrates how to display the items in the ComboBox drop down with headers. The approach uses a GridView inside of the Editable and NonEditable Templates."
TextWrapping="Wrap"
Margin="10" />
<StackPanel Margin="10">
<TextBlock Text="NonEditable ComboBox" />
<telerik:RadComboBox x:Name="nonEditableCombo"
MinWidth="300"
HorizontalAlignment="Left"
ItemsSource="{Binding Materials}"
NonEditableTemplate="{StaticResource NonEditableComboBox}"
DisplayMemberPath="Name"
VerticalAlignment="Top"
StaysOpenOnEdit="True"
SelectedItem="{Binding SelectedMaterial, Mode=TwoWay}"
SelectionChanged="combo_SelectionChanged">
</telerik:RadComboBox>
</StackPanel>
<StackPanel Margin="10">
<TextBlock Text="Editable ComboBox" />
<telerik:RadComboBox x:Name="editableCombo"
MinWidth="300"
MaxDropDownHeight="400"
HorizontalAlignment="Left"
ItemsSource="{Binding Materials}"
IsEditable="True"
EditableTemplate="{StaticResource EditableComboBox}"
DisplayMemberPath="Name"
VerticalAlignment="Top"
StaysOpenOnEdit="True"
SelectedItem="{Binding SelectedMaterial, Mode=TwoWay}"
SelectionChanged="combo_SelectionChanged">
</telerik:RadComboBox>
</StackPanel>
</StackPanel>
</UserControl>