We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Show thousand separator in grid field

Hello,


I have a grid column below:

  <GridColumn Field="@nameof(FD.Amt)" HeaderText="Total Amount" EditType="EditType.NumericEdit" Format="N2"

                            TextAlign="TextAlign.Right" Width="30">

                    <Template>

                        @{

                            var value = (context as FD);

                            var TotalAmount = "";


                            TotalAmount = (value.OnlineAmount + value.InterestAmount).ToString();


                            <div>@TotalAmount</div>

                        }


                    </Template>

                    <EditTemplate>

                    </EditTemplate>

                </GridColumn>


Despite using FORMAT="N2", the grid result still shows the following



Please help,


regards


Sao



1 Reply 1 reply marked as answer

BL Balamurugan Lakshmanan Syncfusion Team April 10, 2023 03:44 PM UTC

Hi Sao,


Greeting from Syncfusion support.


We modify the sample to achieve your requirement. Kindly refer the below code snippet ,attached solution file and screenshot for your reference.


<Template>

 

                @{

 

                    var value = (context as FD);

 

 

 

 

 

                    double TotalAmount =Convert.ToDouble( (value.OnlineAmount + value.InterestAmount));

 

 

                    var data=TotalAmount.ToString("N2");

 

                    <div>@data</div>

 

                }

 

 

 

            </Template>





Kindly get back to us if you have further queries.


Regards,

Bala.


Attachment: BlazorApp1_eb5beee6.zip

Marked as answer
Loader.
Up arrow icon