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
390
How to disable default contect menu while in editmode
posted

I got a contextmenu in my grid that appears when i right click a cell. The problem i've been having is that when i rightclick a cell while being in editmode the default copy/paste contextmenu appears.

Now i've been able to fire the MouseUp event (and tried MouseDown aswell) using this example:
http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=3036

However when i rightclick while being in editmode now i first get the default contextmenu and after i close that (with Esc or clicking somewhere else for example) my contextmenu appears. I just want to disable the default context menu and get my contextmenu to apear right away.

I've been looking around for abit and tried to implement the following code in my form (that contains the UltraGrid):


        protected override void WndProc(ref System.Windows.Forms.Message m)
        {
            //Suppress the message to display the context menu
            const int WM_CONTEXTMENU = 0x7b;

            if (m.Msg != WM_CONTEXTMENU)
                this.WndProc(ref m);
        }

Apperantly overriding the WndProc function lets you suppress default windows behaviour but i've not been able to get it to work. I get a stackoverflow on the If statement while loading the form.

What i mostly find weird is that i saw a similair topic on this forum:
http://forums.infragistics.com/forums/t/5035.aspx

However he does not have the default copy/paste contextmenu problem.

Thanks in advance.

Parents Reply Children
No Data