On the basis of my last question around unbound DataGridView’s this could be me….
I have a numeric column in my DGV and I’ve set its type to Int32. If I do not edit the value I can retrieve the value as an int but if I edit the cell the value changes to a decimal.
I may be retrieving the value incorrectly so I’ve attached an updated sample.
When you run the sample:
Thanks
Nic
Nic,
the bug has been logged as WJ-8910 and is fixed in the latest release (1.4.95)
Best regards
Frank
There is a difference between DataGridViewNumericUpDownColumn and DataGridViewNumericUpDownCell. The column type allows you to change the value type, while the NumericUpDown cell is set to decimal since the NumericUpDown control’s value property is also decimal. Will log the bug.
Also Wisej allows cells of different types to be mixed in the same column. i.e. a column could contain a datetime cell and a combobox cell, etc.
It’s easy to set up a column/cell with the Int32 value type like this:
class DataGridViewInt32Column : DataGridViewNumericUpDownColumn
{
public DataGridViewInt32Column() { this.CellTemplate = new DataGridViewInt32Cell(); }
}
class DataGridViewInt32Cell : DataGridViewNumericUpDownCell
{
public override Type ValueType { get { return typeof(int); } }
}
Please login first to submit.