Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
615
Editting of double values
posted

Hi,

I'm trying to create some sort of data editor, but I'm experiencing troubles when it comes to editting double values. I created a simple grid with two columns (name and defaultValue), set the "name" column to readonly and added a numeric editor provider to the other column (and thus enabled editting etc). However, when I add a value of (for example 7.8) this is displayed in the grid as "7,8" (note the comma here!). But when I double click on the value and the editor is shown, the value in the editor is suddenly just "7".

I tried to set the culture of the numeric editor provider to "Dutch (Netherlands)" but this isn't saved in the code behind (but "Dutch (Belgium)" is!?), so I changed "Belgium" to "Netherlands", but this didn't help at all.

So the question is: how can I tell the grid that "7.8" isn't "7" but just "7.8" (or "7,8" since we are using a comma as decimal separator in The Netherlands)?

  • 1000
    posted

    Maybe you can try the following:

    Add these lines in the Page.Load

    Dim nf1 As System.Globalization.NumberFormatInfo = New System.Globalization.NumberFormatInfo()
    nf1.NumberGroupSeparator = ""
    nf1.NumberDecimalSeparator = ","
    WebNumericEdit1.NumberFormat = nf1

    I know you are using them in a datagridview and maybe this could help you achieve your goal.

    good luck