Hello,
Using the inline edit mode of the grid, I'd like to change the EditType of a Column based on the selection from a DropDownList on the page. The options in the list are String, Integer and Number (Decimal).
I've tried setting the EditType property to a variable which is updated when the DropDownList selection is changed, but when anything but String is selected, the column editor is blank when the row is edit mode.
I've also tried to modify the EditorSettings in a similar fashion with no success.
The desired outcome is that when "String" is selected, any value may be added in the column. When Integer is selected, only numbers, no decimals are allowed. When Number is selected a number with up to 3 decimals is allowed.
Any help is greatly appreciated!
Hi Lee,
Greetings from Syncfusion.
We understood your query and we suspect that you want to change the EditType of the column dynamically. We need some details regarding your requirement. Could you please share the below details which will be helpful to validate and provide a better solution?
Regards,
Rahul
The issue is that the underlying datatype of the field that the column is bound to is "string". When you try to change it to EditType.Numeric, no input is rendered due to the conflicting datatype.
I've worked around this by using an edit template and adding additional properties to bound class that are of the double datatype and then in the setter of those properties, they update the primary property that I use to save to my DB. And of course, I have logic in the template that determines what input should be rendered and what property it's bound to.
There are probably other ways to handle this, but it's working for now.
Thanks!
Lee Phillips
Hi Lee,
Thanks for the update
We are glad to hear that you have resolved your query on your own. Kindly get back to us if you need further assistance.
Regards,
Monisha