Hi,
I'm Interest for the AutoCompleteBox Control but i have this issue:
Ihave this CustomFilteringBehavior:
and in my main page i used this CustomFilteringBeahvior:
when typing :

in SelectionMode="Multiple" all works fine but
in SelectionMode="Single" the result after selection is :

is there any idea for this behavior ?
Thank you in advance,
I'm Interest for the AutoCompleteBox Control but i have this issue:
Ihave this CustomFilteringBehavior:
public
class
CustomFilteringBehavior : FilteringBehavior
{
public
override
System.Collections.Generic.IEnumerable<
object
> FindMatchingItems(
string
searchText, System.Collections.IList items, System.Collections.Generic.IEnumerable<
object
> escapedItems,
string
textSearchPath, TextSearchMode textSearchMode)
{
var searchTextToUpper = searchText.ToUpper();
var matchingItems = items.OfType<Person>().
Where(x => x.FirstName.ToUpper().Contains(searchTextToUpper) || x.LastName.ToUpper().Contains(searchTextToUpper)
|| (x.FirstName +
" "
+ x.LastName).ToUpper().Contains(searchTextToUpper));
return
matchingItems.Where(x => !escapedItems.Contains(x));
}
}
and in my main page i used this CustomFilteringBeahvior:
<UserControl.Resources>
<local:ViewModel x:Key=
"ViewModel"
/>
<local:CustomFilteringBehavior x:Key=
"CustomFilteringBehavior"
/>
<DataTemplate x:Key=
"CustomItemTemplate"
>
<StackPanel Orientation=
"Horizontal"
>
<TextBlock Text=
"{Binding FirstName}"
/>
<TextBlock Text=
" "
/>
<TextBlock Text=
"{Binding LastName}"
/>
</StackPanel>
</DataTemplate>
</UserControl.Resources>
<Grid x:Name=
"LayoutRoot"
Background=
"White"
DataContext=
"{StaticResource ViewModel}"
>
<StackPanel>
<telerik:RadAutoCompleteBox ItemsSource=
"{Binding People}"
FilteringBehavior=
"{StaticResource CustomFilteringBehavior}"
DropDownItemTemplate=
"{StaticResource CustomItemTemplate}"
BoxesItemTemplate=
"{StaticResource CustomItemTemplate}"
SelectionMode=
"Single"
AutoCompleteMode=
"Suggest"
/>
</StackPanel>
</Grid>
when typing :
in SelectionMode="Multiple" all works fine but
in SelectionMode="Single" the result after selection is :
is there any idea for this behavior ?
Thank you in advance,