开发者

silverlight telerik radcombobox problem with autocomplete

开发者 https://www.devze.com 2023-03-13 08:00 出处:网络
I have a telerik radcombobox, I want to use the autocomplete feature so I set IsEditable to true and telerik:Text开发者_Python百科Search.TextPath to the correct property. The autocomplete instead of l

I have a telerik radcombobox, I want to use the autocomplete feature so I set IsEditable to true and telerik:Text开发者_Python百科Search.TextPath to the correct property. The autocomplete instead of letting you type and just suggesting is automatically selecting a choice (when there is more than one choice available)

<UserControl.Resources>
    <DataTemplate x:Key="ItemTemplate">
        <Border Margin="5">
            <StackPanel>

                <Image Source="{Binding ImageUrl}" MaxWidth="25" MaxHeight="25" />
                <TextBlock Text="{Binding Name}" FontWeight="Bold"/>
                <TextBlock Text="{Binding DataSourceName}" />
            </StackPanel>
        </Border>
    </DataTemplate>

    <DataTemplate x:Key="SelectionBoxTemplate">
        <TextBlock Text="{Binding Name}" FontWeight="Bold"/>
    </DataTemplate>
</UserControl.Resources>

<Grid>
    <telerik:RadComboBox IsEditable="True" telerik:TextSearch.TextPath="Name" MinWidth="100" Grid.Column="1" 
        SelectedValue="{Binding SelectedObjectType, Mode=TwoWay}" ItemsSource="{Binding ObjectTypes}" ItemTemplate="{StaticResource ItemTemplate}" 
                         SelectionBoxTemplate="{StaticResource SelectionBoxTemplate}"/>
</Grid>

Is this a telerik's bug or is there a way to do it work properly ?


I haven't seen a way to make the auto-complete present a list of options instead of only showing the first match. The CanAutocompleteSelectItems property seemed promising but didn't actually seem to help.

However, it looks like you are trying to auto-complete on the items in the drop down? If that's the case, you might want to try setting IsFilteringEnabled to true and OpenDropDownOnFocus to true also. That way, when you click on the combo box, the dropdown will open showing all the options and as you type, only the matching items will be shown. That might give you the desired behavior....or at least close. I wish I knew of a better way.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号