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

RadContextMenu run server side and client side

2 Answers 40 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Cagdas
Top achievements
Rank 1
Cagdas asked on 06 Dec 2013, 07:25 PM
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 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 09 Dec 2013, 04:15 AM
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.
0
Cagdas
Top achievements
Rank 1
answered on 09 Dec 2013, 09:20 AM
Thanks Shinu, worked for me code
Tags
Ajax
Asked by
Cagdas
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Cagdas
Top achievements
Rank 1
Share this question
or