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://ko.infragistics.com/community/forums/f/ultimate-ui-for-wpf/86785/select-all-text-when-editing-the-value
https://ko.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
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 TonevAssociate Software DeveloperInfragistics
Hello Tihomir,
thanks - this does the trick for me.