I am using a SfNumericTextBox InputView on a SfTextInputLayout. I also reduced the InputViewPadding. The hint is not properly aligned when the form is first rendered. After clicking in the SfTextInputLayout and then clicking elsewhere the hint is aligned, but not on first appearance. Any suggestions?
I am pasting the code below.
var balance = new SfNumericTextBox()
{
TabIndex = 4,
AllowNull = true,
BorderColor = Color.Transparent,
FormatString = "c",
ReturnType = ReturnType.Next,
ReturnCommand = new CoreCommand((obj)=>
{
TxtNotes.Focus();
})
};
var txtBalance = new SfTextInputLayout
{
Hint = AppResources.Balance,
IsVisible = true,
InputView = balance,
InputViewPadding = new Thickness(0,5),
Margin = new Thickness(0,10,0,0),
ContainerBackgroundColor = Color.Transparent,
};
I have duplicated the issue in the attached solution. The issue occurs when using a hint bound to a Resx field. The balance hint should be left aligned like it is after clicking on the balance field and then losing focus on that field.
Second question, is there anyway to auto format currency as the user types? For example if they type a 1 the entry would display 0,01 or 0.01 depending on the culture. Then if they type 2 the entry would update to 0,12 or 0.12 depending on the culture. I tried using valuechanged on the SfNumericTextBox, but was unable to get the desired result.
Regards,
Seth
Attachment: SfTextInputLayout_a0c1193f.zip
Hi Eswaran,
Thanks for the sample code in query 2. I tried it and it only formatted the currency on unfocus. I was hoping to format the currency while typing. I tried to modify the example, but couldn't get it to work.
I did achieve the desired result using an entry control. It will format any decimal while typing and will display the currency on the unfocused event. It would be nice if this type of functionality was baked into the SfNumericTextBox control.
Also, there may be room for improving my sample code if you see anything?
Thanks,
Seth