This is a migrated thread and some comments may be shown as answers.

Show a option list in valuesProvider, with 3 or less elements.

2 Answers 20 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jesús
Top achievements
Rank 1
Jesús asked on 03 Mar 2017, 01:42 AM

Hello!

I need some help showing a list of elements in my DataForm. Originally i created a funcionallity based on a option list (NSInteger property of my BO) that has many elements to display (lets say 10). Then, this option list has been reduced to show only 2 elements. Unfortunelly, in my DataForm this option list is replaced by an segmented control (i think because is less than 4 elements, the minimum that shows an option list), and because of that, all my work with the data form is not used. So i would like to know if there is a way to use a option list by default for 3 or less elements in valuesProvider. And how can i achieve it?

Greetings!

2 Answers, 1 is accepted

Sort by
0
Accepted
Todor
Telerik team
answered on 07 Mar 2017, 09:42 AM
Hello Jesús,

Thank you for your interest in DataForm for iOS.

Your observation is correct that when your list of values contains less than 4 elements the default editor is TKDataFormSegmentedEditor. You can easily set your preferred editor through the editorClass property:

_dataSource[@"myProperty"].valuesProvider = @[@"Option 1", @"Option 2", @"Option 3"];
_dataSource[@"myProperty"].editorClass = [TKDataFormOptionsEditor class];

I hope this information helps.

Regards,
Todor
Telerik by Progress
Want to build beautiful Android apps as well? Check out UI for Android which enables the same set of scenarios, allowing you to create the same great app experience on both iOS and Android.
0
Jesús
Top achievements
Rank 1
answered on 07 Mar 2017, 07:40 PM

So easy and so helpful. 

Just added the last line to mi property and it works!

Thanks a lot, Todor!

Tags
DataForm
Asked by
Jesús
Top achievements
Rank 1
Answers by
Todor
Telerik team
Jesús
Top achievements
Rank 1
Share this question
or