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

Thousand Separator

3 Answers 440 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Tooraj
Top achievements
Rank 1
Tooraj asked on 25 Oct 2010, 10:10 AM
Hi,
I want to show contents of GriView column with thousand separator, please write a sample code.
Thank you, Tooraj Azizi.

3 Answers, 1 is accepted

Sort by
0
Accepted
Emanuel Varga
Top achievements
Rank 1
answered on 25 Oct 2010, 02:06 PM
Hello Tooraj,

In order to achieve this behavior you can register for the DataBindingComplete event, and enable the ThousandSeparator for the DecimalColumn.
void radGridView1_DataBindingComplete(object sender, GridViewBindingCompleteEventArgs e)
{
    var decimalColumn = radGridView1.Columns["DecimalColumn"] as GridViewDecimalColumn;
    decimalColumn.ThousandsSeparator = true;
}

Hope this helps, if you have any other questions or comments, please let me know,

Best Regards,
Emanuel Varga
0
Rutuja
Top achievements
Rank 1
answered on 04 Aug 2017, 03:16 PM

Hi , I tried to use this code but its not working.

The column name is 'amount' and I added this code, please can you help me in this.

private void radGridView2_DataBindingComplete(object sender, GridViewBindingCompleteEventArgs e)
{

var decimalColumn = radGridView2.Columns["Amount"] as GridViewDecimalColumn;
decimalColumn.ThousandsSeparator = true;
}

1
Dimitar
Telerik team
answered on 07 Aug 2017, 07:40 AM
Hello Rutuja,

Please note that this formats the value in the editor only. If you want it to be visible in the cells when not editing you need to set the format string:
var decimalColumn = radGridView1.Columns[0] as GridViewDecimalColumn;
decimalColumn.ThousandsSeparator = true;
decimalColumn.FormatString = "{0:n}";

I hope this will be useful. Let me know if you have additional questions.

Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
GridView
Asked by
Tooraj
Top achievements
Rank 1
Answers by
Emanuel Varga
Top achievements
Rank 1
Rutuja
Top achievements
Rank 1
Dimitar
Telerik team
Share this question
or