Text selection in RadNumericMaskedEntry

1 Answer 90 Views
MaskedEntry
Gabriel
Top achievements
Rank 1
Gabriel asked on 04 Nov 2022, 05:11 PM

Hi, I need select all text on focus in RadNumericMaskedEntry. Like in RadEntry, but I not found this feature.

 

Tks.

1 Answer, 1 is accepted

Sort by
0
Gabriel
Top achievements
Rank 1
answered on 05 Nov 2022, 05:25 AM

After some tries I found a solution. When get focus, just get the entry and do the selection

radNumericMaskedEntry.Focused += async (_, _) =>
                {
                    var radentry = radNumericMaskedEntry.Children.FirstOrDefault() as RadEntry;
                    if (radentry?.Text?.Length > 0)
                    {
                        //// Selection works only if wait cursor appearing
                        await Task.Delay(200);

                        radentry.CursorPosition = 0;
                        radentry.SelectionLength = radentry.Text.Length;
                    }
                };
Tags
MaskedEntry
Asked by
Gabriel
Top achievements
Rank 1
Answers by
Gabriel
Top achievements
Rank 1
Share this question
or