Watermark remains in RadWaterMarkTextBox when bound property has value.

13 posts, 0 answers
  1. Stephen
    Stephen avatar
    43 posts
    Member since:
    Apr 2012

    Posted 11 Nov 2013 Link to this post

    Occasionally, when the program is loading in data, a watermark text box will show both the value in the text box and the watermark.  It happens maybe 2% of the time and I cannot re-create it on demand.  I attached a screenshot.  There are two fields which show both.
  2. Alek
    Admin
    Alek avatar
    78 posts

    Posted 14 Nov 2013 Link to this post

    Hi Stephen,

    We are not aware of such behavior. We tried to reproduce the issue but  we did not manage.
    We tested the RadWatermarkTextBox under latest official version (2013.3.1016.1050).
    Could you please tell us what dll version you are using in your application?

    Regards,
    Alek
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. DevCraft banner
  4. Stephen
    Stephen avatar
    43 posts
    Member since:
    Apr 2012

    Posted 14 Nov 2013 Link to this post

    Thank you for your reply.

    We are on 2013.2 724

    This problem doesn't happen all the time.  It isn't something I can re-create specifically.  If I do the same thing 20 times, it will likely happen once.  It is a very simple implementation of a watermarked text box, with a binding to an object (mvvm).  We have a Got and Lost focus event, which only comes into play when a user enters the box.  So, in this case, that part doesn't apply.  This problem happens when we are loading the screen with the user's information from the database.

    <telerik:RadWatermarkTextBox Width="90"
                                 Height="25"
                                 Margin="10,0,0,0"
                                 IsReadOnly="{Binding ViewIsReadOnly,
                                                      Mode=OneWay}"
                                 MaxLength="50"
                                 Text="{Binding BookingViewModel.CurrentPerson.BirthForeignInformation,
                                                Mode=TwoWay}"
                                 Visibility="{Binding CountryBirthIsForeign}"
                                 WatermarkContent="Foreign State">
        <i:Interaction.Triggers>
            <i:EventTrigger EventName="GotFocus">
                <ei:CallMethodAction MethodName="BirthForeignGotFocus"
                                     TargetObject="{Binding}" />
            </i:EventTrigger>
            <i:EventTrigger EventName="LostFocus">
                <ei:CallMethodAction MethodName="BirthForeignLostFocus"
                                     TargetObject="{Binding}" />
            </i:EventTrigger>
        </i:Interaction.Triggers>
    </telerik:RadWatermarkTextBox>
  5. Alek
    Admin
    Alek avatar
    78 posts

    Posted 19 Nov 2013 Link to this post

    Hello Stephen,



    Thank you for sending us the code snippet but it does not give us a clear view what is happening in the application.

    It would be of great help if you can send us a working sample where the issue can be reproduced, as you wrote, occasionally.



    in any case we will keep this information for a future reference of there are other clients experiencing the same behavior.





    Regards,

    Alek
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.































    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.































    Sign up for Free application insights >>
  6. Stephen
    Stephen avatar
    43 posts
    Member since:
    Apr 2012

    Posted 19 Nov 2013 Link to this post

    All that is going on is the value is bound to an object and when the screen loads, that object is being populated while everything else on the screen is initializing.  The end result is that the control shows both the value of the property the text is bound to and the watermark, at the same time.  I honestly do not have the time to try and recreate the entire scenario in something I can send you as we are under a time crunch.  I guess we will have to just live with it until other people report it.
  7. Ricky
    Ricky avatar
    21 posts
    Member since:
    Feb 2011

    Posted 19 Nov 2013 Link to this post

    I'm having a similar issue. It is odd because we have used the RadWaterMarkTextBox within the application without this issue.

    I have narrowed it down to the RadWaterMarkTextBox being used within a ListBox or ItemsControl and using bindings within that context.

    It doesn't expose both the watermark and textbox value initially, but if I do the following it issue appears:

    1. Set textbox to value
    2. Save and reload page
    3. Click on textbox
    4. Make the textbox lose focus
  8. Stephen
    Stephen avatar
    43 posts
    Member since:
    Apr 2012

    Posted 19 Nov 2013 Link to this post

    In my case it is not being used inside of another control, but it is using bindings to a property of an object in the view model to set it's value.  Also, in my case the field hasn't yet been entered or exited via the UI.
  9. Ricky
    Ricky avatar
    21 posts
    Member since:
    Feb 2011

    Posted 19 Nov 2013 Link to this post

    I've narrowed it down to a focus issue. I resolved it by having a focus & focuslost event handlers that reset the CurrentText property to the Text value.
  10. Alek
    Admin
    Alek avatar
    78 posts

    Posted 22 Nov 2013 Link to this post

    Hi,

    A possible reason for such behavior could be if you have a custom style applied.
    As an attached file you can find a sample project. Could you please modify it in order to reproduce the issue and send it back to us?

    Regards,
    Alek
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  11. Steven
    Steven avatar
    18 posts
    Member since:
    Sep 2012

    Posted 12 Feb 2014 Link to this post

    We have experienced a similar issue where we have a RadGridView and the RadWatermarkTextBox is bound to the selected item of the grid (which exposes a string the box's text binds to). If the grid only has one row, even though the selected item is bound and works and has a value, the textbox text (current and text) never updates. In fact, the ONLY time seems to be if the grid has more than 1 row and the user can click the other row, then click back. If they do that, the WatermarkTextBox will correctly display the text for the selected row. But if the grid loads and ONLY has 1 row then the TextBox never displays the text for the selected row. Haven't found a way around it so we've simply removed the text box. We've tried using the DataLoaded event to directly update the text box's value with the selected item and that still doesn't work. It stubbornly holds a null value unless you click around some rows.

    We've done Mode=TwoWay on the selected item, we've bound to CurrentItem, we've tried event handlers - nothing. If the box is bound to the selected item and there's only 1 item in the grid, it never updates. Only if you have multiple rows and click around will it update.
  12. Kalin
    Admin
    Kalin avatar
    1208 posts

    Posted 17 Feb 2014 Link to this post

    Hi Steven,

    I tried to reproduce the described issue but no avail. I created a sample project with a GridView and a WatermarkTextBox and it works as expected with single row as well as with multiple rows. I'm attaching the sample project here so you can check it and let me know if there is something I'm missing. You could also share some more details about the version of controls you are using (I tested it with the latest release version).

    I'm looking forward to hearing from you.

    Regards,
    Kalin
    Telerik

    Check out the new Telerik Platform - the only modular platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native apps. Register for the free online keynote and webinar to learn more about the Platform on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT).

  13. Stephen
    Stephen avatar
    21 posts
    Member since:
    Dec 2013

    Posted 18 Feb 2014 in reply to Kalin Link to this post

    I think it is probably an odd combination of things.  We use these controls all the time.  There is only one place where we ever see this occur and it doesn't even occur all the time.  So, I am stuck in a place where I cannot give you something that reproduces the issue, because of the infrequency in which it happens.

    We are using the latest release version of the Silverlight UI, along VS 2012, and IE 11.
  14. Steven
    Steven avatar
    18 posts
    Member since:
    Sep 2012

    Posted 18 Feb 2014 in reply to Kalin Link to this post

    Thanks for the sample project, I agree it is the same scenario we have where the textbox is bound to a property of the SelectedItem. I can't explain the results we were seeing because in all the debugging (including using diagnostics on the binding) the value SHOULD have been displayed.

    In any case, I went back and simply deleted the control off the view then readded it and rebound it to the selecteditem property and now it works.

    So I'm happy now with the view, thanks for the reply and sample.

    Steve
Back to Top
DevCraft banner