4 Answers, 1 is accepted
0
Hello Brian,
You can easily achieve the desired scenario by using templates in the Items of the RadContextMenu. Here you can see an example with the RadMenu that would work identically with the RadContextMenu.
Kind regards,
Kate
the Telerik team
You can easily achieve the desired scenario by using templates in the Items of the RadContextMenu. Here you can see an example with the RadMenu that would work identically with the RadContextMenu.
Kind regards,
Kate
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Brian
Top achievements
Rank 1
answered on 10 May 2013, 02:33 PM
That helps a bit, but I'm running into a new problem. I've placed a button inside a context menu which is within an AjaxPanel, but the button click is causing a full postback. Do you see any reason why the click isn't ajaxified?
<
telerik:RadAjaxPanel
runat
=
"server"
ID
=
"AjaxPanel"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
OnAjaxRequest
=
"RadAjaxRequest"
Height
=
"100%"
>
<
telerik:RadContextMenu
Id
=
"RadMenuUnprioritized"
Runat
=
"server"
onitemclick
=
"RadMenuUnprioritized_ItemClick"
>
<
Items
>
<
telerik:RadMenuItem
PostBack
=
"false"
runat
=
"server"
>
<
ItemTemplate
>
<
telerik:RadButton
ID
=
"btnStandard"
runat
=
"server"
Text
=
"Submit"
AutoPostBack
=
"true"
onclick
=
"btnStandard_Click"
>
</
telerik:RadButton
>
</
ItemTemplate
>
</
telerik:RadMenuItem
>
</
Items
>
<
Targets
>
<
telerik:ContextMenuControlTarget
ControlID
=
"Grid_Unprioritized"
/>
</
Targets
>
</
telerik:RadContextMenu
>
</
telerik:RadAjaxPanel
>
0
Brian
Top achievements
Rank 1
answered on 10 May 2013, 03:46 PM
I sorta solved the problem by calling the click method on the MenuItem via javascript. The only problem left is that an ajax call is also made when clicking the background of the MenuItem..
function setPriority() {
var menu = $find("<%=RadMenuUnprioritized.ClientID %>");
var templateButton = menu.findItemByText("RadMenuItem1");
templateButton.click();
return false;
}
<
telerik:RadAjaxPanel
runat
=
"server"
ID
=
"AjaxPanel"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
OnAjaxRequest
=
"RadAjaxRequest"
Height
=
"100%"
>
<
telerik:RadContextMenu
Id
=
"RadMenuUnprioritized"
Runat
=
"server"
onitemclick
=
"RadMenuUnprioritized_ItemClick"
>
<
Items
>
<
telerik:RadMenuItem
Text
=
"RadMenuItem1"
PostBack
=
"true"
runat
=
"server"
>
<
ItemTemplate
>
<
telerik:RadTextBox
ID
=
"RadTextBox4"
runat
=
"server"
AutoPostBack
=
"True"
Width
=
"50px"
></
telerik:RadTextBox
>
<
telerik:RadButton
ID
=
"btnStandard"
runat
=
"server"
Text
=
"Submit"
AutoPostBack
=
"false"
OnClientClicked
=
"setPriority"
>
</
telerik:RadButton
>
</
ItemTemplate
>
</
telerik:RadMenuItem
>
</
Items
>
<
Targets
>
<
telerik:ContextMenuControlTarget
ControlID
=
"Grid_Unprioritized"
/>
</
Targets
>
</
telerik:RadContextMenu
>
</
telerik:RadAjaxPanel
>
0
Hi Brian,
Please take a look at the following demo where you can find a very good example how to use contextmenu with a RadGrid control - Ajax Enabled Context Menu
All the best,
Kate
the Telerik team
Please take a look at the following demo where you can find a very good example how to use contextmenu with a RadGrid control - Ajax Enabled Context Menu
All the best,
Kate
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.