Override RadAutoCompleteBox

2 posts, 0 answers
  1. Guy
    Guy avatar
    3 posts
    Member since:
    Dec 2012

    Posted 18 Feb 2013 Link to this post

    Hi
    we are  trying to override RadAutoComplete default style. (right click on the control in Document outline window=> Edit Template => Edit A copy)
    We would like that the RadListBox Popup that appears when a text is being typed in the RadAutoCompleteBox will have a different style.
    (The new popup template will be => TextBlock as a Header than the RadListBox then TextBlock as a footer).
    The  RadAutoCompleteBox is binded the to a ObservableCollection.
    The problem is that the when we try to override the default style (we haven't change it yet, we just use it) no values appear in the  ListBox.
    If we don't  override the default style the RadAutoComplete  works fine.
    Can you help us solve the problem?

    (this section will be overrided to achieve the desired behavior:
        <Popup x:Name="PART_Popup">
                                    <Grid x:Name="PopupRoot">
                                        <telerik:RadListBox x:Name="PART_ListBox" CanKeyboardNavigationSelectItems="{x:Null}" IsTabStop="False" ItemTemplate="{TemplateBinding DropDownItemTemplate}" IsTextSearchEnabled="True" MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{TemplateBinding MinDropDownWidth}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" SelectedValueBinding="{x:Null}" TextBinding="{x:Null}" KeyboardNavigation.TabNavigation="Once">
                                            <telerik:StyleManager.Theme>
                                                <telerik:Office_BlackTheme/>
                                            </telerik:StyleManager.Theme>
                                        </telerik:RadListBox>
                                    </Grid>
                                </Popup>


    )





     

  2. Masha
    Admin
    Masha avatar
    355 posts

    Posted 21 Feb 2013 Link to this post

    Hi Guy,

    Simply add ItemsSource="{TemplateBinding FilteredItems}" to the telerik:RadListBox:
    <telerik:RadListBox x:Name="PART_ListBox"
    ItemsSource="{TemplateBinding FilteredItems}"
    CanKeyboardNavigationSelectItems="{x:Null}" IsTabStop="False"
    ItemTemplate="{TemplateBinding DropDownItemTemplate}" IsTextSearchEnabled="True" MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{TemplateBinding MinDropDownWidth}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" SelectedValueBinding="{x:Null}" TextBinding="{x:Null}" KeyboardNavigation.TabNavigation="Once">
    and the RadListBox content will be shown.

    I hope this helps.

    Kind regards,
    Maria
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
Back to Top