We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

SfPicker and SelectedItem

Hi All,
Is it possible to set the SelectedItem of a SfPicker and the displayd value in the same time ?
My selecteditem seems to be set , but the displayed numbers are totally different.
Best regards.

5 Replies

VA Vinnalan Aravazhi Syncfusion Team May 24, 2018 10:14 AM UTC

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: https://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. 



GM Gilles MARTINEZ replied to Vinnalan Aravazhi May 24, 2018 11:39 AM UTC

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. 


Thx for the reply.

I use the sfpicker like a datetime picker (i used your documentation to populate the picker)

When i try to set the value like below nothing happens :

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;           }


VA Vinnalan Aravazhi Syncfusion Team May 25, 2018 06:41 AM UTC

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: https://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.
 



GM Gilles MARTINEZ replied to Vinnalan Aravazhi May 25, 2018 08:58 AM UTC

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.



VA Vinnalan Aravazhi Syncfusion Team May 28, 2018 04:06 AM UTC

Hi Gilles,

Thanks for the update.

We are glad to know that we have achieved your requirement and Please let us know if you have any other queries.

Regards,
Vinnalan K A.

Loader.
Up arrow icon