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

How to change currency symbol in Summary row

3 Answers 195 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Shanti 😎
Top achievements
Rank 2
Veteran
Shanti 😎 asked on 27 Oct 2020, 09:41 AM

Hi,

How to change currency symbol in Summary row. Currency showing default dollar symbol. I want to replace with Indian currency symbol.

This is my code.

 

Dim summaryRowItem As GridViewSummaryRowItem = New GridViewSummaryRowItem()

        For i = 1 To RadGridView.Columns.Count - 1

            Dim summaryItem As GridViewSummaryItem = New GridViewSummaryItem()
            summaryItem.Name = RadGridView.Columns(i).Name

            If TypeOf RadGridView.Columns(i) Is GridViewDecimalColumn Then

                summaryItem.Aggregate = GridAggregateFunction.Sum
                summaryItem.FormatString = "{0:c}"
                summaryRowItem.Add(summaryItem)

            End If

        Next

        RadGridView.SummaryRowsTop.Add(summaryRowItem)
        RadGridView.MasterView.SummaryRows(0).PinPosition = PinnedRowPosition.Bottom

 

Thank you.

3 Answers, 1 is accepted

Sort by
0
Accepted
Nadya | Tech Support Engineer
Telerik team
answered on 27 Oct 2020, 03:56 PM

Hello, Shanti,

RadGridView offers the GroupSummaryEvaluate event where you have access to the calculated value according to the values that are stored in the respective cells. Thus, you can format what exactly is displayed in the summary cell. More information is available here: https://docs.telerik.com/devtools/winforms/controls/gridview/rows/summary-rows 

Please refer to the following code snippet:

Private Sub RadGridView1_GroupSummaryEvaluate(ByVal sender As Object, ByVal e As GroupSummaryEvaluationEventArgs)
    If e.SummaryItem.Name = "UnitPrice" Then
        e.FormatString = String.Format("₹ {0}", e.Value)
    End If
End Sub

I hope this information helps. Should you have other questions please let me know.

Regards,
Nadya
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Shanti 😎
Top achievements
Rank 2
Veteran
answered on 28 Oct 2020, 09:52 AM

Thank you..

 

 Private Sub grdSearch_GroupSummaryEvaluate(sender As Object, e As GroupSummaryEvaluationEventArgs)
        If e.Value IsNot Nothing Then
            Dim culture As CultureInfo = Nothing
            culture = New CultureInfo("hi-IN")
            e.FormatString = String.Format(culture, "{0:c}", e.Value)
        End If
    End Sub

0
Nadya | Tech Support Engineer
Telerik team
answered on 28 Oct 2020, 12:19 PM

Hello, Shanti,

Using the CultureInfo class is also a possible solution. Thank you for sharing it with the community. 

Should you have other questions do not hesitate to contact us.

Regards,
Nadya
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
GridView
Asked by
Shanti 😎
Top achievements
Rank 2
Veteran
Answers by
Nadya | Tech Support Engineer
Telerik team
Shanti 😎
Top achievements
Rank 2
Veteran
Share this question
or