This is a migrated thread and some comments may be shown as answers.
Context menu - open a pop up
4 Answers 93 Views
This is a migrated thread and some comments may be shown as answers.
Andy Green
Top achievements
Rank 2
Andy Green asked on 22 Dec 2015, 09:25 AM

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

4 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 25 Dec 2015, 07:12 AM
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
0
Andy Green
Top achievements
Rank 2
answered on 04 Jan 2016, 09:33 AM

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

 

0
Andy Green
Top achievements
Rank 2
answered on 05 Jan 2016, 08:51 AM

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

0
Veselin Tsvetanov
Telerik team
answered on 07 Jan 2016, 10:58 AM
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
Tags
Menu
Asked by
Andy Green
Top achievements
Rank 2
Answers by
Eyup
Telerik team
Andy Green
Top achievements
Rank 2
Veselin Tsvetanov
Telerik team
Share this question
or