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
250
Xam editors not selecting the entire text/number when receive focus
posted

 Hi,

 I have several types of editors on a page. I want when the users TAB to a control or click on it, the entire text or number to be selected. 

 

By default the editors would put the cursor at the beginning of the control.

 What do I need to do for the editors to select the entire text or number.

 

Thanks very much in advance.

Dimitar 

Parents
  • 1405
    posted

    Hy.

    I used the properties SelectionStart and SelectionLength for XamTextEditor and it's working. Here is the example. Maybe it will help.

    Nico

    <Window x:Class="WpfApplication1.Window1"

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    Title="Window1" Height="300" Width="300" xmlns:my="clr-namespace:Infragistics.Windows.Editors;assembly=Infragistics3.Wpf.Editors.v7.2">

    <Grid>

    <my:XamTextEditor Height="21.277" Margin="66,51,79,0" Name="xamComboEditor1" VerticalAlignment="Top" Text="aaaaaaa" />

    <my:XamTextEditor Height="21.277" Margin="72,105,79,0" Name="xamComboEditor2" VerticalAlignment="Top" Text="bbbbbbbb" GotFocus="xamComboEditor2_GotFocus"/>

    </Grid>

    </Window>

     

    private void xamComboEditor2_GotFocus(object sender, RoutedEventArgs e)

    {

    xamComboEditor2.SelectionStart = 0;

    xamComboEditor2.SelectionLength = xamComboEditor2.Text.Length;

    }

Reply Children