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
640
How to get xamNumericEditor to clear contents when starting to edit
posted

How do you get the xamNumericEditor to clear it's content once the user starts to input data into the textbox like the xamDataGrid does.  I am using the same mask,

 Mask="{}{double:7.3:c}" ,

but the xamNumericEditor keeps the current contents and moves it to the left as you type.  I want the same functionality that comes out of the box using the same editor in the xamDataGrid, where it clears its contents, and then populates right to left.  Just so you know, I can get it to populate right to left, but not clear it's contents

  • 54937
    Verified Answer
    Offline posted

    The editor class is the same. With regards to clearing the existing contents, essentially like a textbox if the text is selected then typing will overwrite that otherwise what is typed is added at the location of the caret. If just happens that when you click or tab into a cell, the grid will call SelectAll on the editor after edit mode has started. You could do a similar thing with the editor you are using. e.g.

    private void XamMaskedEditor_EditModeStarted(object sender, EditModeStartedEventArgs e)
    {
    ((ISupportsSelectableText)sender).SelectAll();
    }