After sfpicker opens the selection, how to open the selection again? Thank you

I downloaded the official example
After testing, it is found that you cannot open the selection dialog box again after opening the selection for the first time
Thank you

Attachment: QQ短视频20210427094601_d90fcf49.rar

5 Replies 1 reply marked as answer

SP Sakthivel Palaniyappan Syncfusion Team April 27, 2021 11:08 AM UTC

Hi Team,

Greetings from Syncfusion.

We have analyzed your query and checked the reported issue based on your provided video, but we were unable to reproduce the issue. Sample we tried to reproduce the issue which you can download from below location.

Sample:
https://www.syncfusion.com/downloads/support/directtrac/general/ze/PickerSample1043717915.zip

Could you please share following details?

1. Update Syncfusion and Xamarin.Forms NuGet version.
2. Can you please check the issue with the attached sample and let us know whether it is reproduced or not? If the issue was not reproduced in this sample, please revert us by modifying the sample based on your application along with replication procedure or provide the sample.
3. Update language you have used in your device and update device details.

It will help us to provide better solution at the earliest.

Regards,
Sakthivel P.



? ? April 28, 2021 02:40 AM UTC

After changing to MVVM, the above problems will appear
I have changed the demo you sent to MVVM binding mode
The problem appears. You can have a look. Thank you

The file is too big. There are always errors in uploading
I deleted the obj and bin directories in the Android project

Attachment: PickerSample20210428_b041fb60.rar

Another question is:
Can the titles of the cancel and OK buttons be changed? Thank you


SP Sakthivel Palaniyappan Syncfusion Team April 28, 2021 02:56 PM UTC

Hi Team,

Thanks for the update.

We can resolve the reported issue by setting Mode as TwoWay as like below code snippet.

XAML:

 
  <syncfusion:SfPicker 
            x:Name="picker" 
            HeaderText="Select a Color" 
            IsOpen="{Binding IsOpenColor,Mode=TwoWay}" 
            ItemsSource="{Binding Colors}" 
            PickerMode="Dialog" 
            ShowFooter="True" /> 

Please let us know if you have any other queries.

Regards,
Sakthivel P.
 


Marked as answer

? ? April 28, 2021 03:14 PM UTC

Another question is:
How to modify the text of cancel and OK? Thank you


SP Sakthivel Palaniyappan Syncfusion Team April 29, 2021 02:50 PM UTC

Hi Team,

Thanks for the update.

We can achieve your requirement by using Localization as like below code snippet.

C#:
 
        public MainPage() 
        { 
            InitializeComponent(); 
            On<Xamarin.Forms.PlatformConfiguration.iOS>().SetUseSafeArea(true); 
            DependencyService.Get<ILocalize>().SetLocale("zh-CN"); 
 
            PickerResourceManager.Manager = 
                         new ResourceManager("PickerLocalization.Resources.Syncfusion.SfPicker.XForms", GetType().GetTypeInfo().Assembly); 
        } 

Android:
 
[assembly: Xamarin.Forms.Dependency(typeof(PickerLocalization.Droid.LocalizationService))]

namespace
PickerLocalization.Droid 
{    public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity 
    { 
 
    } 
    public class LocalizationService : ILocalize 
    { 
        public void SetLocale(string language) 
        { 
            var userSelectedCulture = new CultureInfo(language); 
            Thread.CurrentThread.CurrentUICulture = userSelectedCulture; 
        } 
    } 
} 

(Or )

By using FootView we can achieve your requirement, please refer below link for more details about FootView.

https://help.syncfusion.com/xamarin/picker/dealingwithheaderandfooter?cs-save-lang=1&cs-lang=xaml#set-custom-footer

We have created sample based on this and please find the sample from below.

Sample:
https://www.syncfusion.com/downloads/support/directtrac/general/ze/PickerSample-975698144.zip

Please let us know if you have any other queries.

Regards,
Sakthivel P.
 


Loader.
Up arrow icon