Context menu - open a pop up

5 posts, 0 answers
  1. Andy Green
    Andy Green avatar
    342 posts
    Member since:
    Aug 2008

    Posted 22 Dec 2015 Link to this post

    Hi

    I have a context menu on a RadGrid, with 3 options, 2 of these are functions for the server, and I'm able to send back the index and get the ID serverside.

    For the 3rd option I want to open a pop up window, and pass in the primary key of the row that was selected.

    Is there an example of how this can be done?

    Andy

  2. Eyup
    Admin
    Eyup avatar
    3005 posts

    Posted 25 Dec 2015 Link to this post

    Hello Andy,

    Once you have the index of the item on client-side:
    http://demos.telerik.com/aspnet-ajax/grid/examples/columns-rows/columns/context-menu/defaultcs.aspx#

    You can use one of the approaches below depending on your specific requirements:

    1. PopUp edit mode provided by RadGrid:
    http://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/edit-form-types/defaultcs.aspx


    2. RadWindow:
    http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandwindow/defaultcs.aspx?product=window
    http://demos.telerik.com/aspnet-ajax/window/examples/internalcontent/defaultcs.aspx


    3. RadToolTip:
    https://demos.telerik.com/aspnet-ajax/tooltip/examples/targetcontrolsandajax/defaultcs.aspx?product=tooltip


    Hope this helps.


    Regards,
    Eyup
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Andy Green
    Andy Green avatar
    342 posts
    Member since:
    Aug 2008

    Posted 04 Jan in reply to Eyup Link to this post

    Thanks Eyup

    But I cant see how to get the client ID of the row.

    What I'm trying to achieve is on one of the context menu items is pop up a page and pass in the id of the row. The attached image show the context menu in place - when select a location is clicked this opens the pop up. This works great.

    This  is my context menu at the moment:

    <telerik:RadContextMenu ID="rmCalling" runat="server" Skin="Vista" EnableRoundedCorners="true" EnableShadows="true" >
    <Items>
    <telerik:RadMenuItem Text="Return to Wait" />
    <telerik:RadMenuItem Text="Return to Appointment Location" />
    <telerik:RadMenuItem Text="Select a location" onclick="ShowReturnLocation()" />
    </Items>
    </telerik:RadContextMenu>

    The Javescript SHowReturnLocation() opens the pop up correctly, but I need to also pass in the ID of the clicked row, how do I do that?

    Andy

     

  5. Andy Green
    Andy Green avatar
    342 posts
    Member since:
    Aug 2008

    Posted 05 Jan in reply to Andy Green Link to this post

    Hi

    I have this working now. I have changed my approach, rather than trap the ID on the client and open the pop up I'm using the context menu item click event, and opening the pop up from the server.

    Dim Appointment_ID As Int32 = rdActivity.MasterTableView.DataKeyValues(radGridClickedRowIndex)("ID")

    Case "SelectLocation"
    rwCalling.NavigateUrl = "../Modal/ActivityRTW.aspx?ID=" + ID.ToString
    Dim script As String = "function f(){$find(""" + rwCalling.ClientID + """).show(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);"
    UI.ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", script, True)

    Andy

  6. Veselin Tsvetanov
    Admin
    Veselin Tsvetanov avatar
    278 posts

    Posted 07 Jan Link to this post

    Hi Andy,

    Thank you for getting back to us and letting us know that you have solved the issue.

    Regards,
    Veselin Tsvetanov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017