Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2030
igEditors:XamNumericEditor SelectAll() on Focu
posted

Hello,

I am using the XamNumericEditor and wonder if there is a better solution how to select whole content of the control. What I have seen so far is related to code behind and SelectAll().

https://www.infragistics.com/community/forums/f/ultimate-ui-for-wpf/86785/select-all-text-when-editing-the-value

https://www.infragistics.com/community/forums/f/ultimate-ui-for-wpf/87417/how-change-xamcurrencyeditor-s-default-cursor-position-to-instead-of-cents-when-gotfocus

The idea to create the same codeline over and over again does not look interessting to me.

Is there a property like SelectAllOnFocus that does the trick?

Thanks

Niko

Parents
No Data
Reply
  • 1500
    Verified Answer
    Offline posted

    Hello Nikolaus,

    The requested feature is not currently supported out of the box. However, I can suggest implementing a style with event setter so you can use it just as you would with a property:

                <Style TargetType="{x:Type igEditors:XamNumericEditor}" x:Key="styleName">
                    <EventSetter Event="GotFocus" Handler="HandleFocusEditorEvent"/>
                </Style>

    And in code behind:

    private void HandleFocusEditorEvent(object sender, RoutedEventArgs e)
            {
                ((XamNumericEditor)sender).SelectAll();
            }

    Should you have any further questions, please let me know.

    Sincerely,
    Tihomir Tonev
    Associate Software Developer
    Infragistics

Children