[Our RadAutoCompleteView resides within a RadTreeView]
I'm trying to utilize the Tokens feature of the RadAutoCompleteView control for our POC and I'm unable to get a hold of the selected Tokens. At first, I tried data binding to the Tokens property (Mode=TwoWay) and my view model property was never being set after selecting any number of tokens. So, this might be another bug.
I gave up on trying to bind to Tokens (for now) and tried to utilize the code-behind to directly see which Tokens have been selected. Unfortunately, my named components are not visible to the code behind if they're under a DataTemplate inside a RadTreeView.
In the following code example, "TopicsTreeViewDescriptor" IS visible to the code-behind, but "TopicsExpandCollapseIndicator" (used simply for this test) and "TopicsAutoCompleteView" are NOT visible to the code-behind making it impossible for me to determine which Tokens have been selected.
<telerikDataControls:RadTreeView x:Name="TopicsTreeView" Grid.Row="2" ItemsSource="{Binding Topics}" CheckBoxMode="Propagate" WidthRequest="300"> <telerikDataControls:TreeViewDescriptor x:Name="TopicsTreeViewDescriptor" ItemsSourcePath="Items" DisplayMemberPath="DisplayName" TargetType="{x:Type v1:Topic}"> <telerikDataControls:TreeViewDescriptor.ItemTemplate> <DataTemplate x:Name="TopicsDataTemplate"> <Grid> <!--<Grid.RowDefinitions> <RowDefinition/> <RowDefinition/> </Grid.RowDefinitions>--> <Grid Margin="{Binding Path=Level, Converter={StaticResource LevelToMarginConverter}}" HeightRequest="40" IsVisible="{Binding Item.ShowAutoComplete, Converter={StaticResource InverseBooleanConverter}}"> <Grid.ColumnDefinitions> <ColumnDefinition> <ColumnDefinition.Width> <OnPlatform x:TypeArguments="GridLength" Default="Auto"> <On Platform="UWP">45</On> </OnPlatform> </ColumnDefinition.Width> </ColumnDefinition> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="*"/> </Grid.ColumnDefinitions> <treeView:ExpandCollapseIndicator x:Name="TopicsExpandCollapseIndicator" Grid.Column="0" FontSize="Medium" WidthRequest="10" Margin="15,0" VerticalTextAlignment="Center" IsLoading="{Binding Path=IsLoading}" IsLoadOnDemandEnabled="{Binding Path=IsLoadOnDemandEnabled}" IsExpanded="{Binding Path=Item.Expanded, Mode=TwoWay}" IsLeaf="{Binding Path=IsLeaf}"/> <Image Grid.Column="1" VerticalOptions="Center" Source="{Binding Item.IconName, Converter={StaticResource ImageSourceConverter}}" IsVisible="{Binding Item.ShowAutoComplete, Converter={StaticResource InverseBooleanConverter}}"/> <primitives:RadCheckBox Grid.Column="1" IsChecked="{Binding Path=Item.Checked, Mode=TwoWay}" IsVisible="{Binding Path=Item.IsCheckBoxVisible}" VerticalOptions="Center" /> <treeView:ItemText Grid.Column="2" Margin="8,0,0,0" VerticalOptions="Center" Text="{Binding Item.DisplayName}" /> </Grid> <Grid x:Name="AutoCompleteGrid" Margin="{Binding Path=Level, Converter={StaticResource LevelToMarginConverter}}" IsVisible="{Binding Item.ShowAutoComplete}"> <input:RadAutoCompleteView x:Name="TopicsAutoCompleteView" Text="{Binding Item.SearchText, Mode=TwoWay}" ItemsSource="{Binding Item.Items}" Watermark="Search here..." DisplayMode="Tokens" IsClearButtonVisible="True" CompletionMode="StartsWith" Tokens="{Binding Item.SelectedItems, Mode=TwoWay}" SuggestionItemSelected="RadAutoCompleteView_OnSuggestionItemSelected" TextSearchPath="PortfolioTransactionCustomValue" SearchThreshold="1"/> </Grid> </Grid> </DataTemplate> </telerikDataControls:TreeViewDescriptor.ItemTemplate> </telerikDataControls:TreeViewDescriptor></telerikDataControls:RadTreeView>