Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
510
How to get events from embedded controls using ControlContainerEditor and RenderingControl
posted

I have a cell containing a custom editor.  It is simply a Microsoft Chart embedded into the ControlContainerEditor.RenderingControl.  It displays fine.  But no mouse events are handled by the chart handler.  I suspect that MouseMove for example is being eaten by the grid control.

Is there a way to get the chart events to fire to the handler?

This is my code inside the grid InitializeRow event handler.

Chart chart = new Chart();
chart.MouseMove += Chart_MouseMove;

ControlContainerEditor editor = new ControlContainerEditor();
editor.RenderingControl = chart;
editor.ApplyOwnerAppearanceToEditingControl = false;
editor.ApplyOwnerAppearanceToRenderingControl = false;
editor.EditingControlPropertyName = "Value";
editor.RenderingControlPropertyName = "Value";
e.Row.Cells["Chart"].Editor = editor;