Behavior in gridview cell decimal

2 posts, 0 answers
  1. Bao
    Bao avatar
    51 posts
    Member since:
    Jan 2015

    Posted 27 Sep 2017 Link to this post


    I format gridview cell GridViewDecimalColumn with FormatString : {0:0,0.00}

    and :

      private void gvPart_EditorRequired(object sender, EditorRequiredEventArgs e)
                if (e.EditorType == typeof(GridSpinEditor)
                    && (gvPart.CurrentCell.ColumnInfo.FieldName == "Cost" || gvPart.CurrentCell.ColumnInfo.FieldName == "List"))
                    e.EditorType = typeof(CurrencyEditor);

    But when i tab into cell. this is problem:

    this is i expect:

    Can i move the cursor to the end when i focus to the cell ?

    And when i input with this format with value 2.99 , it will display : 02.99. Can it make it only 2.99 ?


  2. Dess
    Dess avatar
    2428 posts

    Posted 29 Sep 2017 Link to this post

    Hello, Bao, 

    Thank you for writing.  

    Firstly, I would like to note that a post in the forums doesn't guarantee you a response from the Telerik support. If you need some assistance, I would kindly ask you to submit a support ticket. Thus, the Telerik support will gladly assist you. Thank you for your understanding.

    The FormatString property only defines how the values should be displayed by the cells of the GridViewDecimalColumn, not the editor. I can suggest you use a GridViewMaskBoxColumn where you can handle the CellEditorInitialized event and specify the precise format for the editor.

    I hope this information helps. Should you have further questions I would be glad to help.

    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top