Declined
Last Updated: 01 Feb 2024 16:53 by David
David
Created on: 27 Jan 2024 18:03
Category: DataForm
Type: Feature Request
0
Expose Editor's Input Control

Data Form Editors expose the property EditorStyle to allow setting the input control's overall style. But some input control have multiple styles not so easily set.

As the input control is also the Editor's base content, instead exposing content as the appropriate type allows all of the input controls styles to be set.

Here is my working example in my KingdomContacts app for one editor:

namespace KingdomContacts.Controls;
using Telerik.Maui.Controls;
public class KcNumericDfEditor : DataFormRadNumericEditor
{
    public RadNumericInput? Editor => base.Content as RadNumericInput;
}

I have made similar adaptations for all the other Data Form editors I use. Simple and easy to work with; far easier than guessing what to do with EditorStyle.

Would be even easier if a similar line were inside your editors -- then I would not need to make my own customizations.

2 comments
David
Posted on: 01 Feb 2024 16:53
Thank you for considering my suggestion. I made heavy use of the technique I described to truly customize the editors for my needs in building an Appointments Editor DataForm. While I appreciate the team's reasoning, any line that ends with "as x" assures the returned object will actually truly be an object of type x or else it will be null, something I always test for in my code before any use. That seems like a pretty consistent pattern. Nonetheless, my needs are met and again, I thank you for considering my request.
ADMIN
Didi
Posted on: 01 Feb 2024 14:10

Hi David,

Thank you for the provided suggestion.

The team reviewed the case and we have to decline this feature request. Let me explain why:

The way how the DataForm is designed and implemented does not allow us to provide such API. There is a methods that allow you to create default editor when derived from the DataFormXEditor class. If we exposed strongly typed property and in same case the CreateDefaultEditor is overridden, there will be inconsistency in the architecture of the control.

I hope I was able to explain the case. Still you can use the approach you have found. 

Regards,
Didi
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.