I have a DataGridView which is filling from Table in SQL Server Database. One of it’s columns is price.
Type of column in DGV is automatically sets as Decimal.
In some cases I need to write in cells of this column text like “none”, instead of price.
How can I do it?
DGV.Item("price", 0).Value = "none"
doesn’t work, because of decimal type of a cell.
instead of all this,Use datacolumn expression property.
If you just want to change how the data is displayed (and that’s what it sounds like you want), hook the CellFormatting event. Here’s the general idea (code untested):