This is a migrated thread and some comments may be shown as answers.

FormatCurrency in programatically created grid

1 Answer 57 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Darin Beard
Top achievements
Rank 2
Darin Beard asked on 01 Jan 2011, 04:36 PM
I want to use FormatCurrency in a bound column in a grid that is created programatically. I know you can do it with eval when created design time, but I want to do it programatically because it is a dynamic grid. I've check docs and forums and can't find it. Help? Thanks.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 03 Jan 2011, 05:30 AM
Hello Darlin,

You can use the DataFormatString property to specify a custom format for the values displayed in the GridBoundColumn object.

C#:
GridBoundColumn boundColumn;
boundColumn = new GridBoundColumn();
RadGrid1.MasterTableView.Columns.Add(boundColumn);
boundColumn.DataField = "Amount";
boundColumn.HeaderText = "Amount";
boundColumn.DataFormatString = "{0:$###,###.##}";

Thanks,
Princy.
Tags
Grid
Asked by
Darin Beard
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Share this question
or