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

number of digits

1 Answer 48 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Tamás
Top achievements
Rank 1
Tamás asked on 05 Sep 2008, 02:09 PM
Hi,

why does RadGridView round values if I click inside a cell in a column whose underlying data type is double?

For example, one of the cell has a value of 1,234567 from a data source. If I click in the cell to edit it, and the textbox appears, I would like to see explicitly 1,234567 and not a rounded value like 1,23.

If I set a format string for that column, that's ok. Show 1,23. But not when I want to edit the value. By the way, if I set a format string to show only two digits, I will never ever know the precise value!

How can I help this behavior?

Thanks,
Tamás

1 Answer, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 08 Sep 2008, 01:48 PM
Hi Tamás,

Thank you for contacting us.

There are two options to solve this issue:

  1. If you are using the GridViewDecimalColumn, you can specify the precision by changing the DecimalPlaces property:
    ((GridViewDecimalColumn)this.radGridView1.Columns["Value"]).DecimalPlaces = 5; 

  2. Or, you can use a GridViewTextBoxColumn. In this case a simple text box displaying the precise value will be shown.
Should you have any other questions, don't hesitate to write us.

Greetings,
Jack
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
GridView
Asked by
Tamás
Top achievements
Rank 1
Answers by
Jack
Telerik team
Share this question
or