This is a migrated thread and some comments may be shown as answers.

Behavior in gridview cell decimal

1 Answer 57 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Bao
Top achievements
Rank 1
Bao asked on 28 Sep 2017, 04:12 AM

Hi,

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:

https://www.screencast.com/t/sKnDuLLkH

this is i expect: 

https://www.screencast.com/t/RNwqwxUhDwCc

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 ?

 

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 29 Sep 2017, 08:29 AM
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.

Regards,
Dess
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.
Tags
GridView
Asked by
Bao
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or