Hello,
we currently use a HeatMap for our C# WPF (.NET Core) project to visualize data with a custom HeatMapDefinition.
Now we want the HeatMap to show a selection border for the selected cell, but this is not working for us as no selection border is shown.
The problem is easily reproducible in the xaml-sdk (with the CustomHeatMapSourceAndDefiniton project).
Just change in the MainWindow.xaml the RadHeatMap like this:
<telerik:RadHeatMap x:Name="heatmap"
SelectionMode="SingleDataItem"
SelectedCellBorderColor="Magenta"
SelectedCellBorderThickness="5">
...
And limit the GetData parameters in MainWindow.xaml.cs to something like:
CustomHeatMapItem[,] data = this.GetData(20, 30);
According to the documentation, setting SelectionMode, SelectedCellBorderColor and SelectedCellBorderThickness like this should be sufficient, but in our test no border was drawn.
We tested in our project with a CategoricalDefinition and there the selection does work.
Looking into the source code of the HeatMap, the HeatMapColorGrid should be responsible to draw the selection border in different combinations (with and without hover, etc).
In the method RedrawAllCells() for example:
this.DrawSelectedCell(rowIndex, columnIndex, intColor);
However those calls all seem gated by if-checks with a call to this.Definition.IsCellSelected(rowIndex, columnIndex).
Which calls the method IsCellSelected from the current definition casted as HeatMapDefinition.
This method in the HeatMapDefinition always returns false and is internal, so we cannot override it within our derived custom HeatMapDefinition (as opposed to e.g. CategoricalDefinition, which overrides it).
So the question is, how do we get the HeatMap to draw the selection border, if we cannot tell it that the cell is selected?
Or did we miss something?