Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7775833
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:43:28+00:00 2026-06-01T17:43:28+00:00

I attach in my ASP.NET app to a cell oncontextmenu a function string.Format(OnCellContextMenu({0}, ‘{1}’,

  • 0

I attach in my ASP.NET app to a cell oncontextmenu
a function string.Format("OnCellContextMenu({0}, '{1}', true, true)", e.VisibleIndex, e.DataColumn.FieldName).

In my JS i define the following function.

function OnCellContextMenu(visibleIndex, fieldName, hasNote, hasValue) {
    currentVisibleIndex = visibleIndex;
    currentFieldName = fieldName;

    if (fieldName == "Name" || fieldName == "TOTAL") {
        EnableMenuItem('AddNote', false);
        EnableMenuItem('EditNote', false);
        EnableMenuItem('RemoveNote', false);
    }
    else {
        EnableMenuItem('AddNote', !hasNote && hasValue);
        EnableMenuItem('EditNote', hasNote);
        EnableMenuItem('RemoveNote', hasNote);
    }

    window.event.returnValue = false;

    gvPrevisions.SetFocusedRowIndex(visibleIndex);
    GridMenu.ShowAtPos(ASPxClientUtils.GetEventX(event), ASPxClientUtils.GetEventY(event));
}

Now, on IE works properlly, but on Firefox window.event.returnValue = false;
it is not executed. I googled around to see how the Firefox treats this return value and I got that I should call e.preventDefault(); insdead of window.event. The problem is that in my function e is undefined.

Can you please help me finding a solution that works both on FF and IE?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T17:43:29+00:00Added an answer on June 1, 2026 at 5:43 pm

    I found my way out.

    I declared a function in this way:

    function OnCellContextMenu(e, visibleIndex, fieldName, hasNote, hasValue)
    

    and the association in this way:

    e.Cell.Attributes.Add("oncontextmenu", string.Format("OnCellContextMenu(event, {0}, '{1}', true, true)", e.VisibleIndex, e.DataColumn.FieldName));
    

    then in the function I got var currentEvent = (window.event) ? window.event : e;
    and used currentEvent across other function calls like ASPxClientUtils.PreventEventAndBubble(currentEvent);

    Cheers

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating an asp.net app that sends out an email. I need to
I'm building an asp.net MVC application where users can attach a picture to their
I had a macro ( http://weblogs.asp.net/koenv/archive/2008/02/14/quick-attach-and-detach-debugger.aspx ) in Visual Studio 2008 that attaches the
We are using EF 4.2 in an ASP.NET app linked to an Oracle 11
I'm building a simple game in an ASP.NET/VB.NET web app. The game has a
Using ASP.NET MVC and Entity Framework, I encounter some attach/detach errors when I need
I'm using VS2010,C#,SQL Server to develop my ASP.NET web app, although this is not
I am so used to attach a process when debugging ASP.NET application in .NET
I have an ASP.NET 4 web app that is using the Entity Framework to
I have an asp.net 3.5 app that write a zip file to a directory(Ionic

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.