This is a migrated thread and some comments may be shown as answers.

Override RadAutoCompleteBox

1 Answer 173 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
Guy
Top achievements
Rank 1
Guy asked on 18 Feb 2013, 02:58 PM
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>


)





 

1 Answer, 1 is accepted

Sort by
0
Masha
Telerik team
answered on 21 Feb 2013, 10:42 AM
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.

Tags
AutoCompleteBox
Asked by
Guy
Top achievements
Rank 1
Answers by
Masha
Telerik team
Share this question
or