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
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
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
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
Thank you for getting back to us and letting us know that you have solved the issue.
Regards,
Veselin Tsvetanov
Telerik