Articles in this section
Category / Section

How to format values in OLAP Grid value cells?

1 min read

You can format the cell values in OLAP Grid as illustrated in the following code example.

C#               

this.grid.InternalGrid.QueryCellInfo += new Syncfusion.Windows.Controls.Grid.GridQueryCellInfoEventHandler(InternalGrid_QueryCellInfo);
void InternalGrid_QueryCellInfo(object sender, Syncfusion.Windows.Controls.Grid.GridQueryCellInfoEventArgs e)
        {
            //Double value formatted to Currency
            double value = 234509000.00;
            string formatedvalue = string.Format("{0:c}", value);
            e.Style.CellType = "Value";
            e.Style.CellValue = formatedvalue;
            e.Style.Background = Brushes.Cyan;
            e.Handled = true;
        }

VB

Me.grid.InternalGrid.QueryCellInfo += New Syncfusion.Windows.Controls.Grid.GridQueryCellInfoEventHandler(InternalGrid_QueryCellInfo)
    Private Sub InternalGrid_QueryCellInfo(ByVal sender As Object, ByVal e As Syncfusion.Windows.Controls.Grid.GridQueryCellInfoEventArgs)
        'Double value formatted to Currency
        Dim value As Double = 234509000.0
        Dim formatedvalue As String = String.Format("{0:c}", value)
        e.Style.CellType = "Value"
        e.Style.CellValue = formatedvalue
        e.Style.Background = Brushes.Cyan
        e.Handled = True
    End Sub

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied