datagrid currency format problem

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

I am using a windows forms datagrid and am using a table style to add
formating to columns.

I have a curency column like so



DataGridTextBoxColumn SalePriceCol=new DataGridTextBoxColumn();

SalePriceCol.MappingName="SalePrice";

SalePriceCol.HeaderText="Sale Price";

SalePriceCol.Format="c";

SalePriceCol.Alignment=HorizontalAlignment.Center;

ts.GridColumnStyles.Add(SalePriceCol);



When I run the program and try to edit the column and type anything other
that an integer,

The column returns to the previous value. I would like to enter values like
1500.68 and have the grid

accept these values.

Any ideas,

Thanks,

Paul
 
Paul,

I can confirm the DataGridTextBoxColumn behaves just like that :-( When we
had to enable users to enter currency values with currency symbols, we had
to override SetColumnValueAtRow and GetColumnValueAtRow methods to implement
custom parsing and formatting.
 
Back
Top