RadContextMenu run server side and client side

3 posts, 0 answers
  1. Cagdas
    Cagdas avatar
    14 posts
    Member since:
    Nov 2013

    Posted 06 Dec 2013 Link to this post

    Hi friends;
    Problem is RadContextMenu 

    <telerik:RadContextMenu ID="RadMenu1" runat="server"
               EnableRoundedCorners="true" EnableShadows="true" OnClientItemClicked="rightClickHandler">
              
               <Items>
                   <telerik:RadMenuItem Text="Portföy Çek İşlemleri" Value="portfoyCekIslem" >
                       <Items>
                           <telerik:RadMenuItem Text="Portföy Çek Giriş" Value="portCekGir"></telerik:RadMenuItem>
                           <telerik:RadMenuItem Text="Portföy Çek Düzenle" Value="portCekEdit"></telerik:RadMenuItem>
                           <telerik:RadMenuItem Text="Portföy Çek Sil" Value="portCekSil"></telerik:RadMenuItem>
                       </Items>
                   </telerik:RadMenuItem>
     
               </Items>
           </telerik:RadContextMenu>


    Javascript
    function rightClickHandler(sender, args) {
     
                        var menuItemValue = args.get_item().get_value();
     
                        if (menuItemValue == "portCekGir") {
                            openPopupPortfoyCekGirisNew(sender);
                        }
                        else if (menuItemValue == "portCekEdit") {
                            var rowID = $("#radGridClickedRowIndex2").val();
                            openPopupPortfoyCekGirisEdit(sender, rowID)
                        }
                        else if (menuItemValue == "portCekSil") {
                           
                           }
                    }


    How to use Server site portCekSil Method  ? How to use RadContextMenu both server and client

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 08 Dec 2013 Link to this post

    Hi Cagdas,

    Please have a look into the following sample code snippet.

    ASPX:
    <telerik:RadContextMenu ID="RadMenu1" runat="server" EnableRoundedCorners="true"
        EnableShadows="true" OnClientItemClicked="rightClickHandler" OnItemClick="RadMenu1_ItemClick">
        <Items>
            <telerik:RadMenuItem Text="Portföy Çek İşlemleri" Value="portfoyCekIslem">
                <Items>
                    <telerik:RadMenuItem Text="Portföy Çek Giriş" Value="portCekGir">
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem Text="Portföy Çek Düzenle" Value="portCekEdit">
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem Text="Portföy Çek Sil" Value="portCekSil">
                    </telerik:RadMenuItem>
                </Items>
            </telerik:RadMenuItem>
        </Items>
    </telerik:RadContextMenu>

    JavaScript:
    <script type="text/javascript">
        function rightClickHandler(sender, args) {
            var menuItemValue = args.get_item().get_value();
            if (menuItemValue == "portCekGir") {
                alert(menuItemValue);
            }
            else if (menuItemValue == "portCekEdit") {
                alert(menuItemValue);
            }
            else if (menuItemValue == "portCekSil") {
                alert(menuItemValue);
            }
        }
    </script>

    C#:
    protected void RadMenu1_ItemClick(object sender, Telerik.Web.UI.RadMenuEventArgs e)
    {
        if (e.Item.Text == "Portföy Çek Giriş")
            Response.Write(e.Item.Text);
        else if (e.Item.Text == "Portföy Çek Düzenle")
            Response.Write(e.Item.Text);
        else
            Response.Write(e.Item.Text);
    }

    Please elaborate your requirement if it doesn't help.
    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Cagdas
    Cagdas avatar
    14 posts
    Member since:
    Nov 2013

    Posted 09 Dec 2013 Link to this post

    Thanks Shinu, worked for me code
Back to Top