I have an AutoCompleteBox defined like this:
<
telerik:RadAutoCompleteBox
Grid.Row
=
"4"
Grid.Column
=
"1"
HorizontalAlignment
=
"Stretch"
VerticalAlignment
=
"Stretch"
Margin
=
"0,3,6,3"
WatermarkContent
=
"Interviewer's name..."
x:Name
=
"acb_Interviewer"
TextSearchMode
=
"Contains"
AutoCompleteMode
=
"Suggest"
SelectionMode
=
"Single"
DropDownItemTemplate
=
"{StaticResource RoomInterviewerSearchAutoComplete}"
BorderBrush
=
"#FF25A0DA"
BorderThickness
=
"1"
SelectionChanged
=
"Acb_Interviewer_OnSelectionChanged"
/>
<
DataTemplate
x:Key
=
"RoomInterviewerSearchAutoComplete"
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
TextBlock
Text
=
"{Binding}"
Style
=
"{StaticResource AutoCompleteStyle}"
/>
</
StackPanel
>
</
DataTemplate
>
The ItemSource is set to a List<string>.
I then try something like this but acb_Interviewer.SelectedItem remains null and only the watermark is visible in the control.
string
interviewerName = dbContext.Users.First(u => u.Id == interview.PrimaryUserId).FullName;
acb_Interviewer.SelectedItem = interviewerName;
What am I doing wrong?