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

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy

We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

Answered
0
0

I have a ListBox containing ListBoxItems that are UserControls containing a SciChartSurface.

My user needs to be able to select an item in the ListBox. I find that if you click on the SciChartSurface, the item does not get selected. I had to click outside the SciChartSurface to select the ListBoxItem.

Is there an easy way to make SciChartSurface not consume the mouse event? The user will not be manipulating anything in the SciChartSurface so there is no need for it to handle any mouse events.

Thank you.

  • You must to post comments
Good Answer
0
0

I looked at SciChart example [Create Multiseries Charts]=>[Dashboard Style Charts].

It appears (I tried it out and it worked) that putting the SciChartSurface inside a Grid and adding a Border as the last item in the Grid makes the ListBoxItem selectable when clicking on the chart surface.

Sandbox code attached in zip file.

  • You must to post comments
0
0

Hi there,

Do you have any ChartModifiers registered on the SciChartSurface? If there are no ChartModifiers (RubberBandXyZoomModifier, ZoomExtentsModifier) then mouse events will not be handled.

The other thing is that sometimes in WPF elements don’t report mouse events if the background is null. e.g. consider this:

<!-- Clicking the grid does not raise a mouse event -->
<Grid>
   <!-- ... -->
</Grid>

vs

<!-- Clicking the grid does raise a mouse event -->
<Grid Background="Transparent">
   <!-- ... -->
</Grid>

Best regards,
Andrew

  • Kwokon Ng
    No ChartModifiers at all.See, in attached sandbox code, the file ListBoxItemUserControl.xaml. If you comment out the Border block, clicking the chart will not select the item. Uncomment it and it works again. Making grid background “Transparent” or “White” does not work either if Border block is not there. Note, when testing you have to click on the inside of the chart (where the plot lines will be). The problem does not show up if you click on the axes.
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.