context menu not showing

When using the context menu in the grid through loadXML, the menu is not visible.
Using the loadXMLString, the menu is visible.

Sample code :

//Contextual menu
aMenu=new dhtmlXMenuObject();
aMenu.setIconsPath(“classes/menu/imgs/”);
aMenu.setSkin(“dhx_skyblue”);
aMenu.renderAsContextMenu();
aMenu.clearAll();

//grid init
mygrid = new dhtmlXGridObject(‘products_grid’);
mygrid.setImagePath(“grid/imgs/”);
mygrid.setHeader(“NR, ,COL_A,COL_B,COL_C,COL_D,COL_E,COL_F,COL_G”,null);
mygrid.setColTypes(“ro,sub_row,ro,ro,ro,ro,ro,img,ro”);
mygrid.enableMultiline(true);
mygrid.enableMultiselect(true);

mygrid.attachEvent(“onBeforeContextMenu”, function(id,index,obj)
{
if(mygrid.getSelectedId() != null) id_arr=mygrid.getSelectedId().split(",");
else id_arr = new Array();

//single selection
if(id_arr.length <= 1) 
{
	//select the row, show default header menu
	mygrid.selectRowById(id, false);
	aMenu.clearAll();
	aMenu.loadXML("menu/context.xml");
	//aMenu.loadXMLString('<menu><item text="Single" img="test.gif" id="single" /></menu>');
}
//multiple selection
else if(id_arr.length > 1) 
{
	aMenu.clearAll();
	aMenu.loadXML("menu/context_mp.xml");
	//aMenu.loadXMLString('<menu><item text="Multiple" img="test.gif" id="multiple" /></menu>');
}
return true; 

});

//enable context menu
mygrid.enableContextMenu(aMenu);

//initialize grid
mygrid.init();
mygrid.setSkin(“dhx_skyblue”);
mygrid.loadXML(“data.php”);

Tested in IE8, Firefox and Chrome.
In context and context_mp, the code is the same as in loadXMLString.

How to solve?

What version of dhtmlxGrid and dhtmxlMenu are you using?

dhtmlxSuite 2010 Rel.1 (DHTMLX 2.6) Professional edition build 100916