There is no such thing as "convert type". You can "convert" only data, an instance of some type. You can use one of the
System.Decimal.Parse
methods:
http://msdn.microsoft.com/en-us/library/system.decimal.parse%28v=vs.110%29.aspx[
^].
You can set the property
ValueType
, but it can only by used for filtering or sorting the columns with respect to the contents of their cells:
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcolumn.valuetype%28v=vs.110%29.aspx[
^].
In principle, you can also make your own custom column type the same was other column types are made:
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcolumn%28v=vs.110%29.aspx[
^].
The functionality of this column type would depend on what you want, but one thing is certain: its
ValueType
property should return
typeof(System.Decimal)
, and it should return or accept values of this type with the corresponding property
Value
of the specialized
DataGridViewCell
type, which you also have to create, the same way as these:
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcell%28v=vs.110%29.aspx[
^].
—SA