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

Watermark remains in RadWaterMarkTextBox when bound property has value.

12 Answers 74 Views
WatermarkTextBox
This is a migrated thread and some comments may be shown as answers.
Stephen
Top achievements
Rank 1
Stephen asked on 11 Nov 2013, 04:39 PM
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.

12 Answers, 1 is accepted

Sort by
0
Alek
Telerik team
answered on 14 Nov 2013, 02:21 PM
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 >>
0
Stephen
Top achievements
Rank 1
answered on 14 Nov 2013, 02:37 PM
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>
0
Alek
Telerik team
answered on 19 Nov 2013, 07:41 AM

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 >>
0
Stephen
Top achievements
Rank 1
answered on 19 Nov 2013, 12:55 PM
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.
0
Ricky
Top achievements
Rank 1
answered on 19 Nov 2013, 03:36 PM
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
0
Stephen
Top achievements
Rank 1
answered on 19 Nov 2013, 03:56 PM
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.
0
Ricky
Top achievements
Rank 1
answered on 19 Nov 2013, 04:41 PM
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.
0
Alek
Telerik team
answered on 22 Nov 2013, 09:15 AM
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 >>
0
Steven
Top achievements
Rank 1
answered on 12 Feb 2014, 05:02 PM
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.
0
Kalin
Telerik team
answered on 17 Feb 2014, 09:32 AM
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).

0
Stephen
Top achievements
Rank 1
answered on 18 Feb 2014, 02:04 PM
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.
0
Steven
Top achievements
Rank 1
answered on 18 Feb 2014, 02:27 PM
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
Tags
WatermarkTextBox
Asked by
Stephen
Top achievements
Rank 1
Answers by
Alek
Telerik team
Stephen
Top achievements
Rank 1
Ricky
Top achievements
Rank 1
Steven
Top achievements
Rank 1
Kalin
Telerik team
Stephen
Top achievements
Rank 1
Share this question
or