This is a migrated thread and some comments may be shown as answers.

Textbox inside ContextMenu

4 Answers 78 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 1
Brian asked on 09 May 2013, 03:37 PM
Hi,

I need to get a Textbox to show inside a ContextMenu control. If this is possible, can you provide some directions to get this done. If it's not possible, can you provide suggestions on how I can accomplish this.

Thanks. 

4 Answers, 1 is accepted

Sort by
0
Kate
Telerik team
answered on 10 May 2013, 07:02 AM
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
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
Kate
Telerik team
answered on 15 May 2013, 11:16 AM
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
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.
Tags
Menu
Asked by
Brian
Top achievements
Rank 1
Answers by
Kate
Telerik team
Brian
Top achievements
Rank 1
Share this question
or