Category / Section
How to add conditional formats to the grid in OlapClient
1 min read
We can add the conditional formats to the OlapGrid in OlapClient. This can be achieved by following code snippet.
C#
void olapClient_Loaded(object sender, System.Windows.RoutedEventArgs e) { if (this.olapClient.OlapGrid == null) this.olapClient.ApplyTemplate(); if (this.olapClient.OlapGrid != null) { OlapGridDataConditionalFormat condn1 = new Syncfusion.Silverlight.Grid.Olap.OlapGridDataConditionalFormat(); condn1.Conditions.Add(new OlapGridDataCondition() { ConditionType = OlapGridDataConditionType.GreaterThan, Value = 50000, PredicateType = Syncfusion.Windows.Data.PredicateType.Or, MeasureElement = "Internet Sales Amount" }); condn1.CellStyle = new OlapGridCellStyle() { Background = (Brush)new SolidColorBrush(Colors.Red) }; this.olapClient.OlapGrid.ConditionalFormats.Clear(); this.olapClient.OlapGrid.ConditionalFormats.Add(condn1); }
Figure: OlapGrid with applied conditional formats in OlapClient