Hi Gilles,
Thanks for contacting Syncfusion support.
Query: My SelectedItem seems to be set but the displayed value is totally different.
We have checked the reported issue from our side and we are unable to reproduce the reported issue from our side. We have attached the sample in which we have checked the reported issue from our side. Please find the sample from below link.
Sample: http://www.syncfusion.com/downloads/support/forum/137723/ze/PickerSelectedItem271034035
Please check the sample and if the requirement differs please modify the sample in which the issue reproducing sample which will be helpful for us to analyse further and provide an appropriate solution.
Regards,
Vinnalan K A.
private void btSt01_Clicked(object sender, EventArgs e) { //open picker dialog myPicker.IsOpen = !myPicker.IsOpen;
List<object> vals = new List<object>(); vals.Add("15"); vals.Add("35"); myPicker.SelectedItem = vals; }
Hi Gilles,
Thanks for the update.
Query: Is it possible to set the SelectedItem of a SfPicker and the displayed value in the same time ?
We have checked your requirement from our side. In the given code snippet you have used list instead of ObservableCollection as SelectedItem hence displayed numbers are different. Please find the modified sample from below link.
Sample: http://www.syncfusion.com/downloads/support/forum/137723/ze/GettingStartedPicker-1436037658-568702896
Please let us know if you have any other concern.
Regards,
Vinnalan K A.
Thanks for your help. This solution works fine.
I had to add this to my own code :
"DateTimeViewModel : INotifyPropertyChanged"
and use :
"ObservableCollection <object> collection = new ObservableCollection<object>();
.....
picker.SelectedItem = collection"
Thanks for your support.
Best regards.