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

Values Being Rounded

2 Answers 82 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 23 Feb 2016, 07:46 PM

I might just be missing a very simple property here... the rows appear fine as soon as the application is run, but as soon as you click on a row, the value is rounded to two decimal places. Here's my code:

private void RadForm1_Load(object sender, EventArgs e)
{
    RadPropertyStore PropertyStore = new RadPropertyStore();
 
    radPropertyGrid1.SelectedObject = PropertyStore;
     
    PropertyStore.Add(new PropertyStoreItem(typeof(double), "test", 184.9484));
    PropertyStore.Add(new PropertyStoreItem(typeof(double), "test2", 341651.7823));
}

I tried to force the decimal places to remain the same using this, but it did not work:

private void radPropertyGrid1_EditorInitialized(object sender, PropertyGridItemEditorInitializedEventArgs e)
{
    PropertyGridTableElement te = sender as PropertyGridTableElement;
    PropertyGridSpinEditor editor = e.Editor as PropertyGridSpinEditor;
 
    if (editor != null && te != null)
    {
        ((BaseSpinEditorElement)editor.EditorElement).DecimalPlaces = 5;
    }
}

How can I prevent my values from being rounded?

 

Thanks!

2 Answers, 1 is accepted

Sort by
0
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 26 Feb 2016, 12:33 PM
Hello Ryan,

Thank you for writing.

It is a known problem with RadPropertyGrid. Here is the feedback item for your reference: http://feedback.telerik.com/Project/154/Feedback/Details/120331-fix-radpropertygrid-propertygridspineditor-automatically-rounds-decimal-values

Feel free to use the suggested workaround in the referred item.

I hope this information helps. Should you have further questions I would be glad to help.
 
Regards,
Dess
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Ryan
Top achievements
Rank 1
answered on 02 Mar 2016, 04:08 PM
Thank you, Dess!
Tags
PropertyGrid
Asked by
Ryan
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Ryan
Top achievements
Rank 1
Share this question
or