6 Answers, 1 is accepted
0
Hi Klejda,
I have created a sample that shows how to achieve the described scenario. The solution works in both scenarios: DisplayMode="Plain" or the DisplayMode="Tokens".
Please take a look at the attached project and let me know if you have any additional questions on this.
Regards,
Didi
Progress Telerik
I have created a sample that shows how to achieve the described scenario. The solution works in both scenarios: DisplayMode="Plain" or the DisplayMode="Tokens".
Please take a look at the attached project and let me know if you have any additional questions on this.
Regards,
Didi
Progress Telerik
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Feedback Portal
and vote to affect the priority of the items
0
Klejda
Top achievements
Rank 1
answered on 19 Feb 2019, 06:46 AM
The problem is that we are using Xamarin Forms and i need to have my events in the ViewModel and nothing in the back code .
So I want to get the SelectedItem in my ViewModel where i can create and fire my event . I saw your example but it is not what i am looking for .
0
Hello Klejda,
Currently, the RadAutoCompleteView does not provide a command equivalent to the SuggestionItemSelected event. In this case you will need to use a Xamarin.Forms EventToCommandBehavior.
You'll get the event args as a command parameter and add the selected item to the RadDataGrid ItemsSource.
For example:
Please take a look at the attached project how this could be achieved and let me know if you have any additional questions or concerns.
Regards,
Didi
Progress Telerik
Currently, the RadAutoCompleteView does not provide a command equivalent to the SuggestionItemSelected event. In this case you will need to use a Xamarin.Forms EventToCommandBehavior.
You'll get the event args as a command parameter and add the selected item to the RadDataGrid ItemsSource.
<
telerikInput:RadAutoCompleteView.Behaviors
>
<
local:EventToCommandBehavior
EventName
=
"SuggestionItemSelected"
Command
=
"{Binding SuggestionSelectedCommand}"
/>
</
telerikInput:RadAutoCompleteView.Behaviors
>
public
Command SuggestionSelectedCommand {
get
;
set
; }
private
void
OnSuggestedSelected(
object
obj)
{
if
(obj
is
SuggestionItemSelectedEventArgs e)
{
var item = e.DataItem;
this
.SelectedItems.Add((Person)item);
}
}
Please take a look at the attached project how this could be achieved and let me know if you have any additional questions or concerns.
Regards,
Didi
Progress Telerik
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Feedback Portal
and vote to affect the priority of the items
0
Klejda
Top achievements
Rank 1
answered on 19 Feb 2019, 12:44 PM
It worked perfectly , exactly what i was looking for .
No , at the moment that i want to remove a selected item , i want to remove it from the grid too .
Is there any way to do this ?
0
Klejda
Top achievements
Rank 1
answered on 19 Feb 2019, 12:44 PM
Now*
0
Accepted
Hi Klejda,
I have modified the attached project regarding how to Add and Remove items to the RadDataGrid using the Tokens Collection of the AutoCompleteView control. Please take a look at the MyConverter.cs and MainPage.xaml files how this could be achieved.
I hope this could help.
Regards,
Didi
Progress Telerik
I have modified the attached project regarding how to Add and Remove items to the RadDataGrid using the Tokens Collection of the AutoCompleteView control. Please take a look at the MyConverter.cs and MainPage.xaml files how this could be achieved.
I hope this could help.
Regards,
Didi
Progress Telerik
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Feedback Portal
and vote to affect the priority of the items