THanks. My grid is built based on the DB query dynamically. The fields in DB are types money and deciaml. But it seems that I can not work it out using the follwing function. ANy suggestions?
Thanks for your time
private void gridModel_QueryCellFormattedText(object sender, GridCellTextEventArgs e)
{
if(e.Style.CellValueType == typeof(double))
{
e.Text = ((double)e.Style.CellValue).ToString("#,###");
e.Handled = true;
}
}
>Try this. Make sure your DataColumn type is int so the grid thinks the column is integer.
>
>Then handle the grid.model.QueryCellFormattedText event and format the display text there.
>
>
>this.gridDataBoundGrid1.Model.QueryCellFormattedText += new GridCellTextEventHandler(gridModel_QueryCellFormattedText);
>
>//the handler
>private void gridModel_QueryCellFormattedText(object sender, GridCellTextEventArgs e)
>{
> if(e.Style.CellValueType == typeof(int))
> {
> e.Text = ((int)Style.CellValue).ToString("#,###");
> e.Handled = true;
> }
>}
>