Apply MaskedInputExtensions to RadMaskedNumericInput in code, rather in xaml.

0 Answers 185 Views
GridView MaskedInput (Numeric, DateTime, Text, Currency)
Ian
Top achievements
Rank 1
Ian asked on 02 Jun 2021, 11:55 AM

I'm trying to create a custom column for my RadGridView, where upon editing the cell, an appropriate control is shown - A combobox for a boolean or an enumeration, a RadMaskedTextInput for text, and a RadMaskedNumericInput for numeric values.

I'm using the RadMaskedNumericInput as I need to set maximum and minimum values, and I've seen the samples of how to set minimum & maximum values for the RadMaskedNumericInput when in xaml, by using something like:

 <telerik:RadMaskedNumericInput maskedInput:MaskedInputExtensions.Minimum="0" /> 

However, as I'm creating the control dynamically in the Custom Column class, I can't find a way of doing the same in code? i.e. as part of creating the control using "RadMaskedNumericInput numericTb = new RadMaskedNumericInput();" I also have the same issue in trying to set the Min & Max length extensions for the RadMaskedTextInput control. 

Thanks

Ian
Top achievements
Rank 1
commented on 04 Jun 2021, 08:31 AM

Just to answer my own question, the solutions is to set the value explicitly. e.g: "numericTb.SetValue(MaskedInputExtensions.MinimumProperty, 0);"
Dilyan Traykov
Telerik team
commented on 07 Jun 2021, 09:18 AM

I'm happy to hear you've managed to find a solution for your requirement. Do let me know if I can further assist you with anything else.

No answers yet. Maybe you can help?

Tags
GridView MaskedInput (Numeric, DateTime, Text, Currency)
Asked by
Ian
Top achievements
Rank 1
Share this question
or