SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, iOS Chart, Android Chart and JavaScript Chart Components

0
0

Hello everybody,

I hope you are fine,

I am working with DatapointeselectionModifier on a tablet windows.

I want to be able to select multiple points without pressing Left Ctrl keyboard.
Can you help me please?

Thank you very much.

Version
Version 5
  • You must to post comments
0
0

You’d have to override DataPointSelectionModifier.GetSelectionMode and return SelectionMode.Union to enable multi-select.

This is the definition of GetSelectionMode in DataPointSelectionModifier.

    protected virtual SelectionMode GetSelectionMode(MouseModifier modifierKey, bool isAreaSelection)
    {
        var selectionMode = SelectionMode.Replace;
        if (!AllowsMultiSelection)
        {
            return selectionMode;
        }

        switch (modifierKey)
        {
            case MouseModifier.Ctrl:
                selectionMode = isAreaSelection ? SelectionMode.Union : SelectionMode.Inverse;
                break;
            case MouseModifier.Shift:
                selectionMode = SelectionMode.Inverse;
                break;
        }

        return selectionMode;
    }

Let me know if this helps.

Best regards,
Andrew

  • You must to post comments
0
0

Normally, it works but I am programming with MVVM.

In this case, where can I put this method and where do I need to call the “GetSelection(SelectionMode.Ctrl,false);” ?

Thank you very much Mr Burnett,

Best regards,

Princy

  • You must to post comments
0
0

Correction, Where can I put :

protected override SelectionMode GetSelectionMode()
{
var selectionMode = SelectionMode.Union;
return selectionMode;
}

and call it like I am working with MVVM,

Thank you very much

  • Andrew Burnett-Thompson
    You have to create a class that inherits DatapointeselectionModifier, override GetSelectionMode, then set that modifier on your SciChartSurface. MVVM or not its the same technique.
  • You must to post comments
0
0

Hi Dr Andrew,

It works fine,

thank you very much for your help. 🙂

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.