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

Grouping in Numeric and Currency Columns

I have added GridNumericColumn & GridCurrencyColumn in SfDataGrid Control Binding them to decimal data type of column in datatable

I want to show values grouped as 1,23,45,678.00 but values are show as 12345678.00 

How to achive this

Thanks in advance

3 Replies

SR Sivakumar R Syncfusion Team February 20, 2016 02:29 PM UTC

Hi Amit,

You can achieve your requirement by setting GridNumericColumn.NumberGroupSizes  and GridCurrencyColum.CurrencyGroupSizes properties. Find the code snippet below,

<Syncfusion:GridNumericColumn NumberGroupSeparator="," MappingName="EmployeeSalary">

    <Syncfusion:GridNumericColumn.NumberGroupSizes>

        <Int32Collection>3,2,2,0</Int32Collection>

    </Syncfusion:GridNumericColumn.NumberGroupSizes>
</Syncfusion:GridNumericColumn>


Documentation:
https://help.syncfusion.com/wpf/sfdatagrid/column-types#gridcurrencycolumn
https://help.syncfusion.com/wpf/sfdatagrid/column-types#gridnumericcolumn

Refer below msdn link to understand about setting GroupSizes.
https://msdn.microsoft.com/DA-DK/library/windows/apps/xaml/system.globalization.numberformatinfo.numbergroupsizes

Please let us know if you have any queries.

Thanks,
Sivakumar


AS Amit Saraf replied to Sivakumar R February 22, 2016 06:32 AM UTC

Hi Amit,

You can achieve your requirement by setting GridNumericColumn.NumberGroupSizes  and GridCurrencyColum.CurrencyGroupSizes properties. Find the code snippet below,

<Syncfusion:GridNumericColumn NumberGroupSeparator="," MappingName="EmployeeSalary">

    <Syncfusion:GridNumericColumn.NumberGroupSizes>

        <Int32Collection>3,2,2,0</Int32Collection>

    </Syncfusion:GridNumericColumn.NumberGroupSizes>
</Syncfusion:GridNumericColumn>


Documentation:
http://help.syncfusion.com/wpf/sfdatagrid/column-types#gridcurrencycolumn
http://help.syncfusion.com/wpf/sfdatagrid/column-types#gridnumericcolumn

Refer below msdn link to understand about setting GroupSizes.
https://msdn.microsoft.com/DA-DK/library/windows/apps/xaml/system.globalization.numberformatinfo.numbergroupsizes

Please let us know if you have any queries.

Thanks,
Sivakumar


Thanks for your help

It worked and I got result as wanted.

Amit Saraf


AP Ashwini Paranthaman Syncfusion Team February 22, 2016 12:59 PM UTC

Hi Amit,
Thank you for the update.
Please let us know if you need any other assistance.
Regards,
Ashwini P.

Loader.
Up arrow icon