Key Features

The purpose of this help article is to show you the key features of the RadEntry control.

Watermark

RadEntry exposes WatermarkText property used to give guidance to the end user on what should be entered in the text input. The watermark text is displayed when the control is empty. Additionally, you could set WatermarkTextColor to customize the look of the watermark text.

<telerikInput:RadEntry WatermarkText="First Name" WatermarkTextColor="#6EA3FF" />

Where:

xmlns:telerikInput="clr-namespace:Telerik.XamarinForms.Input;assembly=Telerik.XamarinForms.Input"

Password

RadEntry provides IsPassword Boolean property, which when set to True, replaces the input with password hint character.

<telerikInput:RadEntry IsPassword="True" />

BorderStyle

The BorderStyle property allows you to customize the border around the Entry through the following properties: BorderColor, BorderThickness and CornerRadius. The default value is defined by the OS.

You could define the BorderStyle in the Resources of your page as shown in the example below:

<telerikInput:BorderStyle x:Key="EntryBorderStyle" BorderThickness="1" BorderColor="#4488F6" CornerRadius="8" />

And then apply that Style to the Entry instance:

<telerikInput:RadEntry x:Name="entry" WatermarkText="First Name" BorderStyle="{StaticResource EntryBorderStyle}"/>

Text Selection

The CursorPosition property can be used to set or return the position at which the next character will be inserted into the Entry control. In addition, the SelectionLength property can be used to set/return the length of text selection within the Entry.

The next snippet shows how both could be applied in order to preselect part of the Text of the Entry when the control receives the focus:

<StackLayout Orientation="Horizontal">
    <telerikInput:RadEntry x:Name="selectEntry" Text="select some text" />
    <telerikInput:RadButton Text="Focus" Clicked="FocusButtonClicked" />
</StackLayout>

And the Clicked event handler:

private void FocusButtonClicked(object sender, System.EventArgs e)
{
    selectEntry.Focus();
    selectEntry.CursorPosition = 7;
    selectEntry.SelectionLength = 9;
}

Here is the end result:

Entry Key Features Example

See Also

Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy