Icon in front of each editor

1 Answer 77 Views
DataForm
Andreas Decke
Top achievements
Rank 1
Andreas Decke asked on 30 Jun 2022, 10:03 PM
Hello,

I've been looking for hours in the example of DataFormControl but found nothing! In the example ReservationExample there are icons in front of the editor. How do they get there?!

Regards

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 04 Jul 2022, 08:01 AM

Hello Andreas,

DataForm for Xamarin wraps native DataForm implementations for Android and iOS and although the Xamarin DataForm does not expose directly API for showing icons with editors, in the example this is implemented through custom renderers on Android and iOS.

Go to QSF.Android and QSF.iOS projects and browse to Renderers->DataForm folder and check ReservationsDataFormRenderer class where you can find the exact implementation. 

On Android we've used GetCustomEditorForProperty method of the DataFormRenderer to create custom editors. In addition, you can check the custom layouts inside Resources->layout folder.

On iOS we've used GetCustomEditorType method to return proper editor per property type. Then inside InitEditor method the editors are customized as the iOS editors directly expose Image property.

Please take a look at the described approach and let me know if you have any additional questions on it.

Regards,
Yana
Progress Telerik

The Premier Dev Conference is back! 

Coming to you live from Progress360 in-person or on your own time, DevReach for all. Register Today.


Tags
DataForm
Asked by
Andreas Decke
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or