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

Show all decimals in edit mode

2 Answers 37 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Den
Top achievements
Rank 1
Den asked on 07 Aug 2013, 07:58 AM
Hello!
I use radgrid with number column. The column contains double numbers(ex: 1.2, 3.4567 and etc). I want to see all decimals in edit mode, but now two digits are shown. How can I resolve it?
Thank you.

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 07 Aug 2013, 08:33 AM
Hi Den,

You can try by setting the DecimalDigits in the APSX page or in the ItemCreated you can set the maximum number of decimals to be displayed during edit.

ASPX:
<telerik:GridNumericColumn DataField="UnitPrice" HeaderText="UnitPrice" UniqueName="UnitPrice"  DecimalDigits="5">

OR

C#:
protected void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
   {
       if (e.Item is GridEditFormItem && e.Item.IsInEditMode)
       {
           GridEditFormItem editItem = (GridEditFormItem)e.Item;
           RadNumericTextBox textbox = (RadNumericTextBox)editItem["UniqueName"].Controls[0];
           textbox.NumberFormat.DecimalDigits = 5;
       }
   }


Thanks,
Princy
0
Den
Top achievements
Rank 1
answered on 07 Aug 2013, 08:57 AM
It works. Thank you.
Tags
Grid
Asked by
Den
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Den
Top achievements
Rank 1
Share this question
or