Hi,
Is it possible to set the AutoComplete text programmatically?
I have the following ListBox:
The ListBox uses this template:
I set the ItemsSource in code behind:
The documentation does state the following:
RadListBox has full autocomplete support - while the control is focused, you can type certain keys and the listbox will select the relative match for the currently typed text.
I'm building a RichTextBox Intellisense application, thus the ListBox is the Intellisense. The application is setup to always send focus back to the RichTextBox so that the user can continue typing.
Is it possible to set the ListBox AutoComplete text in code behind? i.e. when the user types text in the RadRichText box, the text they type is used to set AutoComplete the ListBox.
I've tried setting the TypedText property:
listBox.TypedText = "He";
However this doesn't seem to do anything.
Thank you very much,
Rob
Is it possible to set the AutoComplete text programmatically?
I have the following ListBox:
<
telerik:RadListBox
MinWidth
=
"100"
MaxHeight
=
"250"
x:Name
=
"radListBox"
Grid.ColumnSpan
=
"2"
Visibility
=
"Collapsed"
HorizontalAlignment
=
"Left"
VerticalAlignment
=
"Top"
CanAutocompleteSelectItems
=
"True"
IsTextSearchEnabled
=
"True"
TextSearchMode
=
"Contains"
TextPath
=
"Name"
ItemTemplate
=
"{StaticResource AutoCompleteListBoxTemplate}"
ItemsSource
=
"{Binding autoCompleteListItems}"
MouseDoubleClick
=
"radListBox_MouseDoubleClick"
MouseUp
=
"radListBox_MouseUp"
>
<
telerik:RadListBox.Effect
>
<
DropShadowEffect
ShadowDepth
=
"10"
Color
=
"Gray"
Opacity
=
".4"
Direction
=
"320"
RenderingBias
=
"Performance"
/>
</
telerik:RadListBox.Effect
>
</
telerik:RadListBox
>
The ListBox uses this template:
<
DataTemplate
x:Key
=
"AutoCompleteListBoxTemplate"
>
<
Grid
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
/>
<
ColumnDefinition
/>
<
ColumnDefinition
/>
</
Grid.ColumnDefinitions
>
<
Image
Style
=
"{StaticResource AutoCompleteListBoxIcon}"
Width
=
"10"
Height
=
"10"
Margin
=
"0,0,10,0"
/>
<
TextBlock
Text
=
"{Binding Name}"
Grid.Column
=
"1"
HorizontalAlignment
=
"Stretch"
/>
<
TextBlock
Text
=
""
Grid.Column
=
"2"
HorizontalAlignment
=
"Right"
Margin
=
"5,0,5,0"
/>
</
Grid
>
</
DataTemplate
>
I set the ItemsSource in code behind:
private
void
radRichTextBox_Loaded(
object
sender, RoutedEventArgs e)
{
//Set Autocomplete ListBox itemssource
radListBox.ItemsSource = autoCompleteListItems;
}
The documentation does state the following:
RadListBox has full autocomplete support - while the control is focused, you can type certain keys and the listbox will select the relative match for the currently typed text.
I'm building a RichTextBox Intellisense application, thus the ListBox is the Intellisense. The application is setup to always send focus back to the RichTextBox so that the user can continue typing.
Is it possible to set the ListBox AutoComplete text in code behind? i.e. when the user types text in the RadRichText box, the text they type is used to set AutoComplete the ListBox.
I've tried setting the TypedText property:
listBox.TypedText = "He";
However this doesn't seem to do anything.
Thank you very much,
Rob