This project is read-only.

Currency View in Grid

Dec 9, 2009 at 5:15 PM

Hi there,

Recently surfing in the web, I found this tool and is amazing.

I am looking the way to view in a cell numbers with currency format,  the TextBoxCurrency class works fine when I am editing the cell, but the first time when I do the data load from the numbers are with the currency format.

Any information about this concerns will be appreciated.

TIA

Karim - Mexico

Dec 10, 2009 at 1:11 AM

Hi all,

I found the solution.

the value passed to the cell must be decimal as editor type.

I did the conversion and works fine,

thanks

regards

Karim

Dec 11, 2009 at 12:54 AM

Please, if you can, put a little code example to make this topic better! :-)

Dec 14, 2009 at 5:52 PM

 

// Instantiating a TextBox for editing

SourceGrid.Cells.Editors.TextBox numCurr = new SourceGrid.Cells.Editors.TextBox(typeof(decimal));
numCurr.TypeConverter = new DevAge.ComponentModel.Converter.CurrencyTypeConverter(typeof(decimal));

// Converting as Decimal the datarow value

grid1[nSubRow, nCols] = new SourceGrid.Cells.Cell(Convert.ToDecimal(drMat[cTag].ToString()));
grid1[nSubRow, nCols].Editor = numCurr;

// Text alignment to the right as number.

oCell.TextAlignment = DevAge.Drawing.ContentAlignment.MiddleRight;
grid1[nSubRow, nCols].View = oCell;

 

Dec 17, 2009 at 5:21 AM

Thanks!