Hi,
I created a custom UserControl based on the RadAutoCompleteBox control and I customized the dropdown using a style to have a grouping feature. In the dropdown, for each group, I use a RadExpander containing the group title and a button to expand or collapse the group. If the user use the up/down arrow keys to navigate through the item, when the user are on an expander, I would like to catch to catch the left/right arrow keys to expand/collapse the expander.
How it's possible to do this???
Thank's
Alain
Here is my style:
<Style x:Key="SearchBoxControlItem" TargetType="telerik:RadListBoxItem" BasedOn="{StaticResource RadListBoxItemStyle}">
<Setter Property="FontWeight" Value="Medium" />
<Setter Property="FontFamily" Value="Segoe UI" />
<Setter Property="FontSize" Value="12" />
<Setter Property="IsEnabled" Value="True"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<WrapPanel Grid.Column="0" VerticalAlignment="Center" Orientation="Horizontal" Margin="5 0">
<TextBlock Text="{Binding Name}" Foreground="Black" FontWeight="Normal" IsHitTestVisible="False" TextWrapping="Wrap" VerticalAlignment="Center"/>
<TextBlock Text="{Binding TotalItems, StringFormat='({0})'}" Foreground="Black" FontWeight="Normal" IsHitTestVisible="False" Margin="5 0 0 0" VerticalAlignment="Center"/>
</WrapPanel>
<Rectangle Grid.Column="1" Fill="LightGray" Height="1" Stroke="LightGray" VerticalAlignment="Center" Margin="2 0" />
<telerik:RadExpander Style="{DynamicResource RadExpanderStyle}" Grid.Column="2" Margin="2 0" Loaded="RadExpander_Loaded" Collapsed="RadExpander_CollapsedExpanded" VerticalAlignment="Center" Expanded="RadExpander_CollapsedExpanded" IsTabStop="False" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
I created a custom UserControl based on the RadAutoCompleteBox control and I customized the dropdown using a style to have a grouping feature. In the dropdown, for each group, I use a RadExpander containing the group title and a button to expand or collapse the group. If the user use the up/down arrow keys to navigate through the item, when the user are on an expander, I would like to catch to catch the left/right arrow keys to expand/collapse the expander.
How it's possible to do this???
Thank's
Alain
Here is my style:
<Style x:Key="SearchBoxControlItem" TargetType="telerik:RadListBoxItem" BasedOn="{StaticResource RadListBoxItemStyle}">
<Setter Property="FontWeight" Value="Medium" />
<Setter Property="FontFamily" Value="Segoe UI" />
<Setter Property="FontSize" Value="12" />
<Setter Property="IsEnabled" Value="True"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<WrapPanel Grid.Column="0" VerticalAlignment="Center" Orientation="Horizontal" Margin="5 0">
<TextBlock Text="{Binding Name}" Foreground="Black" FontWeight="Normal" IsHitTestVisible="False" TextWrapping="Wrap" VerticalAlignment="Center"/>
<TextBlock Text="{Binding TotalItems, StringFormat='({0})'}" Foreground="Black" FontWeight="Normal" IsHitTestVisible="False" Margin="5 0 0 0" VerticalAlignment="Center"/>
</WrapPanel>
<Rectangle Grid.Column="1" Fill="LightGray" Height="1" Stroke="LightGray" VerticalAlignment="Center" Margin="2 0" />
<telerik:RadExpander Style="{DynamicResource RadExpanderStyle}" Grid.Column="2" Margin="2 0" Loaded="RadExpander_Loaded" Collapsed="RadExpander_CollapsedExpanded" VerticalAlignment="Center" Expanded="RadExpander_CollapsedExpanded" IsTabStop="False" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>