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
205
Opening ContextMenu on Field Labels
posted

Hello there,

Maybe someone here can point me into the correct direction, i'm trying to get a custom ContextMenu to open when the Label of a Field is (right)clicked... apparently this solution does not work out as expected:

foreach (Field field in Grid.FieldLayouts[0].Fields)

{

ContextMenu contextMenu = new ContextMenu();

LabelPresenter labelPresenter = new LabelPresenter();labelPresenter.MouseRightButtonUp += new MouseButtonEventHandler(labelPresenter_MouseRightButtonUp);

labelPresenter.ContextMenu = contextMenu;

labelPresenter.ContextMenuOpening +=
new System.Windows.Controls.ContextMenuEventHandler(labelPresenter_ContextMenuOpening);

field.Label = labelPresenter;

}

tia

Parents
No Data
Reply Children
No Data