How to get a RadMaskedTextInput custom data field

7 posts, 0 answers
  1. Jackey
    Jackey avatar
    71 posts
    Member since:
    Oct 2014

    Posted 04 Aug 2015 Link to this post

    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


  2. Jackey
    Jackey avatar
    71 posts
    Member since:
    Oct 2014

    Posted 08 Aug 2015 in reply to Jackey Link to this post

    BTW, the article I am referring to is http://docs.telerik.com/devtools/wpf/controls/raddataform/getting-started/defining-custom-datafields
  3. UI for WPF is Visual Studio 2017 Ready
  4. Jackey
    Jackey avatar
    71 posts
    Member since:
    Oct 2014

    Posted 12 Aug 2015 Link to this post

    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

  5. Martin Vatev
    Admin
    Martin Vatev avatar
    90 posts

    Posted 13 Aug 2015 Link to this post

    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
  6. Jackey
    Jackey avatar
    71 posts
    Member since:
    Oct 2014

    Posted 14 Aug 2015 in reply to Martin Vatev Link to this post

    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

  7. Martin Vatev
    Admin
    Martin Vatev avatar
    90 posts

    Posted 19 Aug 2015 Link to this post

    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
  8. Jackey
    Jackey avatar
    71 posts
    Member since:
    Oct 2014

    Posted 21 Aug 2015 in reply to Martin Vatev Link to this post

    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

Back to Top
UI for WPF is Visual Studio 2017 Ready