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

Add color in WatermarkText

1 Answer 100 Views
Entry
This is a migrated thread and some comments may be shown as answers.
Software
Top achievements
Rank 1
Software asked on 08 Feb 2019, 07:38 PM

Hi

We are using RadEntry as entry in our project. If you see the attached image, we want to use WatermarkText as placeholder where the text will have regular color & asterisk will be in red. Is it possible in  RadEntry?

1 Answer, 1 is accepted

Sort by
0
Lance | Manager Technical Support
Telerik team
answered on 08 Feb 2019, 07:57 PM
Hello Tahmina,

There aren't any properties that let you set a different color for different letters in the WatermarkText, the WatermarkTextColor is used for the entire word.

If this is your goal, you can put a separate Label outside the RadEntry for the red asterisk, and show/hide that depending on if there's any Text in the RadEntry.

For example:

<StackLayout Orientation="Horizontal">
    <input:RadEntry WatermarkText="First name" WatermarkTextColor="LightGray" Margin="0" TextChanged="RadEntry_OnTextChanged"/>
    <Label x:Name="AsteriskLabel" Text="*" TextColor="Red" Margin="0" />
</StackLayout>

private void RadEntry_OnTextChanged(object sender, TextChangedEventArgs e)
{
    AsteriskLabel.IsVisible = e.NewTextValue.Length == 0;
}


Regards,
Lance | Technical Support Engineer, Principal
Progress 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
Tags
Entry
Asked by
Software
Top achievements
Rank 1
Answers by
Lance | Manager Technical Support
Telerik team
Share this question
or