ItemsSource change on iOS

Hi.I have currently developed a TimePicker from SfPicker(have 2 columns,Hour and Minute),but we have an oddity required from our bosses,that the timePicker should have 24:00 as well.so I added 24 to hours and change from code the minute collection to not have the other values only 00(normally we have 4 values,00,15,30,45 , so users can select 15 minute step values).now on iOS removing of the minute collection works,but instead when I try to add/insert a new collection,it crashes. I am trying all kind of workarounds to solve this issue,but cannot.Do you have any ideas? It would be also nice if I could simply select the desired value but that does not work on iOS either(after that I would need to lock the selection on 00).

So,this is what I am doing,neither the collection.Add or the selectedItems[1] assignment works on iOS,can you help us out?:
var collection = picker.ItemsSource as ObservableCollection<object>;
if (Time?.Count > 1 && IsOpen)
{
collection.RemoveAt(1);
collection.Add(newMinuteCollection);
var selectedItems = picker.SelectedItem as ObservableCollection<object>;
if (selectedItems?.Count > 1)
{
var newSelectedMinute = Minute00 as object;
selectedItems[1] = newSelectedMinute;
}
}

Regards,Norbert

3 Replies

PA Paul Anderson S Syncfusion Team August 2, 2018 07:08 AM UTC

Hi Tamas, 
 
Thanks for contacting Syncfusion Support. 
 
Based on the given code snippet we prepared a sample and checked your query and we are able to reproduce the reported issue "when I try to add/insert a new collection in the item source, it crashes". We have already logged a bug report for this issue. This issue will be fixed in the upcoming Volume 2 SP2 release which will be rolled out by the end of August 2018. 
 
Regards, 
Paul Anderson 



TC Tamas Cons August 3, 2018 10:09 AM UTC

Thanks.Please note that also in the above code snippet there is the IsOpen check made.this is because I suspect of another bug,on Android if I don't add that check ,the app hangs on collection.Add(newMinuteCollection); line.Please check if it could be another issue and fix both if possible with  "one shot".Thanks a lot!

Regards,Norbert


PA Paul Anderson S Syncfusion Team August 6, 2018 10:54 AM UTC

Hi Tamas, 
 
Thanks for the update. 
 
With the provided code snippet, we have prepared a custom sample with SfPicker Control and we are able to reproduce the reported issue even when the IsOpen is used in the condition. So Please check our custom sample, whether we have reproduced the issue correctly. If not please modify our custom sample to replicate the issue.  
 
In iOS with the latest Volume 2 SP1 assemblies [16.2.0.46] we are unable to reproduce the reported issue, so please check our custom sample in iOS platform. Please find the sample from the below link: 
 
 
Regards, 
Paul Anderson 


Loader.
Up arrow icon