open radwindow using radmenu item click within a template column of radgrid
first, make sure you have "ClientDataKeyNames="Id" " added into the Master Table View of the radgrid
then implement the following javascript:
function OpenRecordBreakdown(Id)
{
var oWnd = radopen("RecordBreakDown.aspx?Id=" + , "rwRecordBreakDown");
oWnd.setSize(900, 600);
oWnd.set_behaviors(Telerik.Web.UI.WindowBehaviors.Move + Telerik.Web.UI.WindowBehaviors.Maximize + Telerik.Web.UI.WindowBehaviors.Resize + Telerik.Web.UI.WindowBehaviors.Close)
oWnd.Center();
}
var lastClickedItem = null;
var clickCalledAfterRadprompt = false;
var clickCalledAfterRadconfirm = false;
function onClientButtonClicking(sender, args) {
if (args.get_item().get_text() == "Delete") {
if (!clickCalledAfterRadconfirm) {
args.set_cancel(true);
lastClickedItem = args.get_item();
radconfirm("Are you sure you want to delete this Item?", confirmCallbackFunction);
}
}
if (args.get_item().get_text() == "Record Breakdown") {
var cell = sender.get_element().parentNode.parentNode;
rowindex = cell.rowIndex; //The row index may vary based on the grid structure.
var grid = $find("<%=rgList.ClientID %>");
var MasterTable = grid.get_masterTableView();
var id = MasterTable.get_dataItems()[rowindex - 2].getDataKeyValue("Id");
OpenRecordBreakdown(id);
args.set_cancel(true);
}
}
function confirmCallbackFunction(args) {
if (args) {
clickCalledAfterRadconfirm = true;
lastClickedItem.click();
}
else
clickCalledAfterRadconfirm = false;
lastClickedItem = null;
}