Hi,
I have a master detail grid where I show a context menu that is populated through a web service. The menu should be different depending on the access rights of the user and if the row is a master of detail row.
In the grid in the ClientSettings-section I have
<ClientEvents OnRowContextMenu="RowContextMenu"></ClientEvents>
which points to
function RowContextMenu(sender, eventArgs)
{
document.getElementById("radGridClickedRowIndex").value = eventArgs.get_itemIndexHierarchical();
}
so I can store the hierarchical key of the row in a hidden field.
In the RadContextMenu I have OnClientItemPopulating="onClientItemPopulatingHandler"
which is
function onClientItemPopulatingHandler(sender, eventArgs)
{
var item = eventArgs.get_item();
var context = eventArgs.get_context();
context["Row"] = document.getElementById("radGridClickedRowIndex").value;
}
so I can send the value of the hidden field to the web service that populated the menu.
In the menu I have only the item
<telerik:RadMenuItem Text="Operations" Value="Action" ExpandMode="WebService" PostBack="true"></telerik:RadMenuItem>
Problem 1:
The menu population works fine when retrieving the values for the first time for each row type, i.e. when showing the menu for a master row the menu is retrieved and likewise for a detail row. However, the second time i right-click on a master or detail row the menu isn't retrieved from the web service again even though I have PersistLoadOnDemandItems=false, i.e. the same menu is shown for all master rows and the same menu is shown for all detail rows. I need the menu to be retrieved for each row because the user doesn't have the same rights to all rows. How can I do this?
------------------
Problem 2:
In the RadContextMenu I have OnItemClick="ContextMenu_ItemClick" that should fire the ContextMenu_ItemClick method when a menu item i clicked. In the menu I have one static item Operations (shown above) and when clicking that a postback is done. The problem is that no postback happens when clicking the dynamically loaded items even though I set .PostBack=true for each RadMenuItemData that is returned by the web service.
Is this a bug or am I doing something wrong? If it's a bug can it be worked around by adding some javascript?
Regards,
Mathias
I have a master detail grid where I show a context menu that is populated through a web service. The menu should be different depending on the access rights of the user and if the row is a master of detail row.
In the grid in the ClientSettings-section I have
<ClientEvents OnRowContextMenu="RowContextMenu"></ClientEvents>
which points to
function RowContextMenu(sender, eventArgs)
{
document.getElementById("radGridClickedRowIndex").value = eventArgs.get_itemIndexHierarchical();
}
so I can store the hierarchical key of the row in a hidden field.
In the RadContextMenu I have OnClientItemPopulating="onClientItemPopulatingHandler"
which is
function onClientItemPopulatingHandler(sender, eventArgs)
{
var item = eventArgs.get_item();
var context = eventArgs.get_context();
context["Row"] = document.getElementById("radGridClickedRowIndex").value;
}
so I can send the value of the hidden field to the web service that populated the menu.
In the menu I have only the item
<telerik:RadMenuItem Text="Operations" Value="Action" ExpandMode="WebService" PostBack="true"></telerik:RadMenuItem>
Problem 1:
The menu population works fine when retrieving the values for the first time for each row type, i.e. when showing the menu for a master row the menu is retrieved and likewise for a detail row. However, the second time i right-click on a master or detail row the menu isn't retrieved from the web service again even though I have PersistLoadOnDemandItems=false, i.e. the same menu is shown for all master rows and the same menu is shown for all detail rows. I need the menu to be retrieved for each row because the user doesn't have the same rights to all rows. How can I do this?
------------------
Problem 2:
In the RadContextMenu I have OnItemClick="ContextMenu_ItemClick" that should fire the ContextMenu_ItemClick method when a menu item i clicked. In the menu I have one static item Operations (shown above) and when clicking that a postback is done. The problem is that no postback happens when clicking the dynamically loaded items even though I set .PostBack=true for each RadMenuItemData that is returned by the web service.
Is this a bug or am I doing something wrong? If it's a bug can it be worked around by adding some javascript?
Regards,
Mathias