This post includes a series of interesting support tickets answered throughout August and September. We hope you find the contents of this post interesting and of business value. Should you have any questions about a particular support ticket, feel free to post a comment in the DevExpress Support Center.
Tips & Tricks
BI Dashboard
T1113658 - How to add a watermark to the exported dashboard
https://supportcenter.devexpress.com/ticket/details/t1112628
BI Dashboard for Web Forms
T1112628 - How to hide the "Export To PDF" button for a particular widget
https://supportcenter.devexpress.com/ticket/details/t1094793Handle the onItemCaptionToolbarUpdated event to customize the toolbar for a specific item. For example, if you need to remove the first export submenu for the Grid dashboard item ("gridDashboardItem1"), you can use the following code:
function onItemCaptionToolbarUpdated(e) { if (e.itemName === "gridDashboardItem1") { var exportMenu = e.options.actionItems.find(item => item.name === 'export-menu'); exportMenu.menu.items.splice(0, 1); } }
T1103211 - How to use Count and CountDistinct in calculated fields
https://supportcenter.devexpress.com/ticket/details/t1103211T1109879 - How to use custom properties to customize Grid column options
https://supportcenter.devexpress.com/ticket/details/t1109879
BI Dashboard for WPF
T1117647 - How to add custom template to Series Labels of the Chart dashboard item
https://supportcenter.devexpress.com/ticket/details/t1117647You can override
ChartItemStyle
to customize nested instances of theChartControl
and associated series options. The folowing code snippet modifies the SeriesLabel.ResolveOverlappingMode option:private void ChartControl_BoundDataChanged(object sender, RoutedEventArgs e) { var chart = (ChartControl)sender; var d = (XYDiagram2D)chart.Diagram; for (int i = 0; i < d.Series.Count; i++) { var label = new SeriesLabel(); label.ResolveOverlappingMode = ResolveOverlappingMode.HideOverlapped; label.ElementTemplate = (DataTemplate)this.FindResource("labelTemplate"); d.Series[i].Label = label; } }
<dx:ThemedWindow.Resources> <DataTemplate x:Key="labelTemplate"> <Label Content="{Binding Path=Text}" Background="LightYellow" BorderThickness="0"/> </DataTemplate> <DataTemplate x:Key="chartTemplate"> <dxc:ChartControl Style="{Binding Path=(dxdash:DashboardLayoutItem.ViewStyle), RelativeSource={RelativeSource TemplatedParent}}" BoundDataChanged="ChartControl_BoundDataChanged"> </dxc:ChartControl> </DataTemplate> </dx:ThemedWindow.Resources> <Grid> <dxdash:DashboardControl x:Name="dashboardControl1"> <dxdash:DashboardControl.ChartItemStyle> <Style TargetType="dxdash:ChartDashboardLayoutItem"> <Setter Property="ContentTemplate" Value="{StaticResource chartTemplate}"/> </Style> </dxdash:DashboardControl.ChartItemStyle> </dxdash:DashboardControl> </Grid>
Chart for WinForms
T1113940 - How to modify the color and size of the Heatmap cells
https://supportcenter.devexpress.com/ticket/details/t1113940
Chart for WPF
T1116213 - How to get the position of a point via a click event on a 2DChart using MVVM patterns
https://supportcenter.devexpress.com/ticket/details/t1116213The correct MVVM approach is to use EventToCommand behavior. Event argument conversion is implemented in the
CustomMouseButtonEventArgsConverter.Convert
method.<dxmvvm:Interaction.Behaviors> <dxmvvm:EventToCommand Command="{Binding ClickCommand}" EventName="MouseDown" PassEventArgsToCommand="True" EventArgsConverter="{local:CustomMouseButtonEventArgsConverter}"/> </dxmvvm:Interaction.Behaviors>
public ICommand ClickCommand { get; } = new DelegateCommand(OnClick); private static void OnClick(Point coordinates) { MessageBox.Show(coordinates.ToString()); }
T1115869 - How to get selected item info on XYDiagram2D
https://supportcenter.devexpress.com/ticket/details/t1115869T1112366 - How to display custom labels for logarithmic x-axis
https://supportcenter.devexpress.com/ticket/details/t1112366To customize the display of axis labels, define Custom Labels as follows:
var label = new CustomAxisLabel(d.sieb, d.sieb.ToString()); ((XYDiagram2D)chartControl2.Diagram).AxisX.CustomLabels.Add(label);
Chart for Web Forms
T1115381 - How to export the Chart control to PDF in Landscape mode with margins
https://supportcenter.devexpress.com/ticket/details/t1115381
Map for WPF
T1108723 - How to color track/route (MapPolylines) based on data
https://supportcenter.devexpress.com/ticket/details/t1108723
Pivot Grid for WinForms
T1114991 - How to avoid cell merge when exporting the Pivot Grid to XLSX in WYSIWYG mode
https://supportcenter.devexpress.com/ticket/details/t1114991T1115238 - How to compare two totals and color the total cell based on a comparison result
https://supportcenter.devexpress.com/ticket/details/t1115238T1113267 - How to get display text for a cell by row and column index
https://supportcenter.devexpress.com/ticket/details/t1113267
Enhancements
Chart for WinForms and WPF
T1110756 - How to extrapolate the Chart's trend line to negative infinity
https://supportcenter.devexpress.com/ticket/details/t1110756Set the
ExtrapolateToNegativeInfinity
property totrue
to extrapolate the Trend Line to negative infinity:WinForms: TrendLine.ExtrapolateToNegativeInfinity
WPF: TrendLine.ExtrapolateToNegativeInfinity