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