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

How to get a RadMaskedTextInput custom data field

6 Answers 182 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
Jackey
Top achievements
Rank 1
Jackey asked on 04 Aug 2015, 02:08 PM
Hi team,
I read the article to learn how to define a custom data field. The RadNumericUpDown seems very simple. Then I want to use the RadMaskedTextInput to define a field of IP address. I get some code snippets from another sdk example.
<telerik:RadMaskedTextInput Grid.Row="0" x:Name="firstInput"
                                                  Grid.Column="1"
                                                  Margin="10 5 10 5"
                                                  HorizontalAlignment="Stretch" TextMode="PlainText"
                                                  Mask="###.###.###.###"
                                                  Value="{Binding IpValue, Mode=OneWay, ValidatesOnExceptions=True, Converter={StaticResource converter}}"
                                                  Text="{Binding IpText, Mode=OneWayToSource, ValidatesOnExceptions=True, UpdateSourceTrigger=LostFocus}" />


Note that there are two values to be bound to. Sorry for my stupidity and i can't come up a way to do that according to the way stated in that article.      

 

Jingfei


6 Answers, 1 is accepted

Sort by
0
Jackey
Top achievements
Rank 1
answered on 09 Aug 2015, 01:01 AM
BTW, the article I am referring to is http://docs.telerik.com/devtools/wpf/controls/raddataform/getting-started/defining-custom-datafields
0
Jackey
Top achievements
Rank 1
answered on 12 Aug 2015, 01:32 PM

I would appreciate a lot if someone could give me some ideas or guidelines. Meanwhile, i am preparing a sample project to demonstrate what i want and the attempts i've tried but failed. I think it would help others to understand what i'm talking about.

-J

0
Martin
Telerik team
answered on 13 Aug 2015, 04:25 PM
Hi Jingfei,

Could you please open a support ticket and provide a runnable sample demonstrating the exact implementation that you are using so we could inspect it locally and provide the best possible solution.

Regards,
Martin Vatev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Jackey
Top achievements
Rank 1
answered on 15 Aug 2015, 01:34 AM

Hi Martin,

I don't think i can create a support ticket. And i mirrored the git repository here git@github.com:hobbycamp/xaml-sdk.git and create a branch add-maskedinput-to-dataform. Could you help me to take a closer look at it and shed me the light how to do it?

Thanks a lot,

-J

0
Martin
Telerik team
answered on 19 Aug 2015, 04:03 PM
Hi Jackey,

Taking a closer look of your project, I understood what the problem is. The type of IpValue property in  Employee.cs class is IpAddressPresentation and this property is bound to
RadMaskedTextInput.Value which expects property of type string.
To get it to working properly you must change IpValue type from IpAddressPresentation to string.

Regards,
Martin Vatev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Jackey
Top achievements
Rank 1
answered on 22 Aug 2015, 02:08 AM

Hi Martin,

Thanks for your time to take a closer at my project. The reason I use a IPAddressPresentation is RadMaskedTextInput can't maintain the IP address properly when users begin edit the content. The Value property of RadMaskedTextInput doesn't contain the '.' which is a separator of the mask.

If I give a string value of '192.168.100.100', it would become '192168100100' and when I can change the first '100' to be '1', then it returns '1921681100'. It's impossible to parse what the real IP address is. But the Text property of RadMaskedTextInput can maintain the information, that's why I mix them up in my project. However, the data field of RadDataForm only support bind to one property. I don't know what else good solution is now.

Hope make myself clear.

Thanks,

-J

Tags
DataForm
Asked by
Jackey
Top achievements
Rank 1
Answers by
Jackey
Top achievements
Rank 1
Martin
Telerik team
Share this question
or