Right Click Menu

Hi there, i have a couple of questions regarding the right click functionality.

I have been asked to allow the user to access custom commands via the right click menu. I read a post that stated that this feature would be coming (dated 2004), and was wondering if this has been implemented in the current assemblies. If so, could you point me in the direction of how to make use of this functionality, if not, do you know when this functionality will be included.

Also, when i start my web app outside of the dev environment, the right clikc menu always appears in the top left corner of the screen. It dissapears when you select an option, but will reappear on a post back. Any ideas what may be causing this.

Finally, currently in the right click menu, we have Copy & Find, but we dont need these, is there any way to remove these options from the right click menu?

Thanks in advance for a quick response.

Danny Brown

Hi Danny,

Thanks for considering Aspose.

Well, currently, you may rename the menu items but cannot add / change the behaviour of those options as this feature will be available soon. You can also remove some menu items, the procedure is a simple one. i.e.,

Create a new javascript language file same like "lang_en.js" (You may also update the existing "lang_en.js" file. but this method is not recommended) which is stored in stored by default in the ...\Program Files\Aspose\Aspose.Grid\agw_client folder,
Open it into notepad and edit it to Save it As for your need. You may comment out the related line(s) e.g., //MenuItemCopy :"Copy", so that the option will not be shown in the context menu when the user utilizes the right click menu of the gridweb.
In your code you may try to set the code: GridWeb1.AGWLanguageFileUrl = "`http://localhost/DemoApplication/lang_ennew.js`";

Also, when i start my web app outside of the dev environment, the right clikc menu always appears in the top left corner of the screen. It dissapears when you select an option, but will reappear on a post back. Any ideas what may be causing this.

Did you write some lines of code in the web.config file and what are those lines. Also, could you give us more details about the issue with your OS, IIS settings, .NET Framework, browser type any other extensions etc.

Thank you.

Thanks for the response,

I tried as you said, however it meerly changes the text of the menu option from 'Copy' to 'undefined'. Would you expect this?

Regarding the second part of my question, my config is as follows:

<?xml version="1.0"?>



<add key="aspose.grid.web.agw_client_path" value="http://localhost/agw_client/"/>

<add key="aspose.grid.web.force_script_path" value="true"/>

<add key="DataServer" value="xxx"/>

<add key="TimesheetReportTemplatePath" value="C:\DevT\VSSPrj\BODYCOTE\Bodycote.TimeTracker\Bodycote.TimeTracker\Templates\ReportTemplate.xls"/>

<add key="SelfCertificationTemplatePath" value="C:\DevT\VSSPrj\BODYCOTE\Bodycote.TimeTracker\Bodycote.TimeTracker\Templates\SelfCertification.doc"/>

<add key="AllocationThreshold" value="1.5"/>

<add key="EndTag" value="END"/>

<add key="HeadTag" value="HED"/>

<add key="TotTag" value="TOT"/>



<compilation debug="true">


<add assembly="System.Design, Version=, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>

<add assembly="System.Windows.Forms, Version=, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

<add assembly="Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>

<add assembly="System, Version=, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

<add assembly="System.Drawing, Version=, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>

<add assembly="System.Data, Version=, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

<add assembly="System.Xml, Version=, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

<add assembly="System.Transactions, Version=, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies>


<authentication mode="Windows"/>



System is Windows XP SP2, VS2005 .NETv2.0, IE7, IIS5.1.

Hope this helps.


Thanks for giving us the details,

We will figure it out soon.

Thank you.


You may use the CustomCommandButton to extend the context menu. Just create a new CustomCommandButton and set its CommandType to CustomCommandButtonType.ContextMenuItem and add it the GridWeb.CustomCommandButtons collection.

Your context menu displaying issue may be caused by wrong xhtml settings. Please check the aspx file, if there is line.

1. if the line is

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
The GridWeb.XhtmlMode should be set to TRUE.

2. if the line is

or no this tag at all,

The GridWeb.XhtmlMode should be set to FALSE.


Thanks a million for that, the menu contexts work a treat. The xhtml was running without a tag but with the flag set to true... your fix seems to have done the job.

The only issue outstanding from this log is that the 'Copy' command still appears on the right click menu (after i ahve commented out the appropriate line in the script file as stated in the post earlier) as undefined. Is there anyway this can be just removed from the collection?

Thanks again


In fact Henry,

I have just edited the script file to have no text for the command instead of commenting out the whole line. This seems to hide the menu option.

Thanks again.


Sorry to come back on this but there still is an issue with the right click menu.

In the development environment (when running on the machine the web app was coded -localhost) the right click menu works as expected. However, when running from a client machine, the right click menu appears in the top left when the page containing the Aspose.Grid component loads. When the user clicks an option, the menu dissapears, however, when they try to use the right click fucntionality (to access our custom commands from menu), the right click menu appears at the bottom of the screen and user clicks do not trigger the required action.

As stated in prev posts, i have removed the DOCTYPE tag with XHTML set to false with no fix and also added the DOCTYPE with XHTML set to true, again with no fix.

Please could you advise ASAP as this is a fundemental flaw in our web application.

I have attached an image to better show you.

Thanks again


Any update to this, this is becoming quite an urgent required fix before we can commit to purchasing the Aspose.Grid component.

Thanks again


Hi Danny,

We will get back to you soon.

Thank you.

Hi Amjad/Henry,

Has there been any progress on this. I have to demo the prototype (that utilises the Aspose.Grid component) on Wednesday this week and the menu problems that currently exist are likley to force management to shelf the progress.

Could this issue be meerly a setup issue on my end?

Any continued help is much appreciated.

Thanks again.


Hi Danny,

We are still checking your issue.

Thanks for being patient!

Hey guys, sorry to keep pestering you on this but its becoming quite urgent now.

I performed a demo of a web application that utilises the Aspose.Grid component. The demo was very well recieved and management is keen to push this out to a larger audience, however, they will not commit to the purchase of the component until i can prove that the issue with the menus has been resolved.

I know you guys have been first rate when it comes to support, so if you could assist in the rectification of this issue ASAP it would be greatly, greatly appreciated so we can push this project over the finish line.

Thanks again for all your help, and I hope to hear from you soon.

Danny Brown

Hey guys,

Thanks for the help here but we have found the cause of the problem.

I noticed that the menu.css was configured to lookup from the localhost - when client machines were connecting, the resource obviously could not be located. I moved the aspose resources (including menu.css) into a folder within my deployed structure and changed the reference in the config to mirror this and this resolved the issue.

Thanks again for all your help on this matter.

We will be in contact soon to organise purchase of the full product.

Danny Brown