Groups | Blog | Home
all groups > dotnet windows forms databinding > february 2006 >

dotnet windows forms databinding : DataGridView CellStyle Format


Steini
2/15/2006 4:45:28 AM
Hello,

my int values in a column should look like "34 m³". I tried to set the
Format Property of the DefaultCellstyle from the column to "0 m³" or "0\"
m³\"". The DataGridView displays it correct, but when I edit the value "34
m³" by deleting the first number to "4 m³" I get an ParsingError. It works
when I delete all inclusive "m³" and writing "4" in the cell.
I also tried a standard Format for example "C2". This works perfect!

Is this a bug or did I something wrong??


Regards,

Bart Mermuys
2/15/2006 5:00:13 PM
Hi,

[quoted text, click to view]

AFAIK it can only parse some basic formattings. So you need to handle
DataGridView.CellParsing and parse the string to a number yourself.

If you have any problems doing this, let me know.

HTH,
Greetings


[quoted text, click to view]

Steini
2/16/2006 9:21:31 AM
Thank You - now all works fine!

[quoted text, click to view]
AddThis Social Bookmark Button