or

<telerik:RadCodeBlock ID="RadCodeBlock2" runat="server"> <script type="text/javascript" language="javascript"> function aspButtonCallbackFn(sender, args) { PageMethods.PrepareForSearchResult(args.get_text(), MyMethod_Result); } function MyMethod_Result(pResult) { if (pResult == 2) { var wnd = $find("<%=modalPopup.ClientID %>"); wnd.show(); } } </script></telerik:RadCodeBlock><telerik:RadWindow ID="modalPopup" runat="server" AutoSizeBehaviors="Width, Height" AutoSize="true" VisibleStatusbar="false" Behaviors="Move" VisibleOnPageLoad="false" ReloadOnShow="true" Modal="true" EnableShadow="true"> <ContentTemplate> <asp:UpdatePanel ID="PdtPnl_ForAddExisting" runat="server" UpdateMode="Conditional"> <ContentTemplate> <div style="display: table; width: 100%"> <div style="display: table-row; vertical-align: middle"> <div style="display: table-cell; padding-top: 10px; padding-left: 10px; padding-bottom: 5px; padding-right: 10px;"> <asp:Label ID="Lbl_Pnl_ForAddExisting" runat="server" Text="" /> </div> </div> </div> <div style="display: table; width: 100%"> <div style="display: table-row; vertical-align: middle"> <div style="display: table-cell; padding-top: 5px; padding-left: 10px; padding-bottom: 10px; padding-right: 5px;"> <asp:Button ID="Bttn_Add_ForAddExisting" Width="100" OnClick="Bttn_Add_ForAddExisting_Click" Text="Add" runat="server" class="button" /> </div> <div style="display: table-cell; padding-top: 5px; padding-left: 5px; padding-bottom: 10px; padding-right: 10px;"> <asp:Button ID="Bttn_Cancel_ForAddExisting" Width="100" OnClick="Bttn_Cancel_ForAddExisting_Click" Text="Cancel" runat="server" class="button" /> </div> </div> </div> </ContentTemplate> </asp:UpdatePanel> </ContentTemplate></telerik:RadWindow>[WebMethod]public static int PrepareForSearchResult(string pText){ if (String.IsNullOrEmpty(pText) == true) { return -1; } _instance.Lbl_Pnl_ForAddExisting.Text = String.Format("Do you want to add '{0}'?", pText); _instance.PdtPnl_ForAddExisting.Update(); return 2;}
1.<telerik:RadComboBox ID="rcbPatientMaritalStatus" EmptyMessage="Start typing marital status or select one" MarkFirstMatch="true" TabIndex="8" Width="160" runat="server">2. <Items>3. <telerik:RadComboBoxItem Text="Single" Value="Single" />4. <telerik:RadComboBoxItem Text="Married" Value="Married" />5. <telerik:RadComboBoxItem Text="Other" Value="Other" />6. </Items>7.</telerik:RadComboBox>1.<asp:RequiredFieldValidator ID="rfvPatientMaritalStatus" ControlToValidate="rcbPatientMaritalStatus" ErrorMessage="Marital Status Required" Display="None" Visible="false" runat="server" />
I pulled this below javascript from the sample article. All works well except for the grid.mastertableview. It is always null.
I have tried it with client row select enable and not.
Is there another setting on the grid that I missed to fuly activate the client side api?
Visual studio 2008 with the Telerik 2008 Q2.
Thanks for any help.
Bill
function ShowEditForm(id, rowIndex) {
var grid = window["<%= rgIncoming.ClientID %>"];
var rowControl = grid.MasterTableView.Rows[rowIndex].Control; <--Problem here
grid.MasterTableView.SelectRow(rowControl,
true);
window.radopen(
"wfProcessIncomingItemV1.aspx?AttachmentID=" + id, "wndProcessAttachment");
return false;
}
function confirmCancelBackFnChild(arg) { // var grid = $telerik.findControl(document.body, "RadGrid2"); var grid = $find("<%= RadGrid1.ClientID %>"); if (arg) { var masterTable = $find("<%= RadGrid1.ClientID %>").get_masterTableView(); var detailTable = grid.get_detailTables()[0]; var detailtableName = detailTable.get_name(); // alert(detailtableName); document.getElementById('<%=HiddenField1.ClientID%>').value = "true"; // detailTable.fireCommand("CancelConfirmed", 0); detailTable.fireCommand("CancelConfirmed", String.Empty); } else { document.getElementById('<%=HiddenField1.ClientID%>').value = "false"; } document.getElementById('<%=HiddenField1.ClientID%>').value = "false"; }protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) { RadGrid grid = (source as RadGrid); if (true && e.Item.OwnerTableView.Name == "DemographicsDependants") // Child Table { switch (e.CommandName) { case "Cancel": int searchlocation = 0; string[] retrievedLocations = (string[])Session["LocationData"]; Array.Sort(retrievedLocations); string location = Session["SessionOtherInfoFacilityName"].ToString().Trim(); searchlocation = Array.BinarySearch(retrievedLocations, location); // if (HiddenField1.Value == "false" && searchlocation >= 0) if (HiddenField1.Value == "false") { e.Canceled = true; Session["savedIndex"] = e.Item.ItemIndex; RadWindowManager1.RadConfirm("Continue with Cancel in Child Table? Warning, you will loose any unsaved work!!!", "confirmCancelBackFnChild", 350, 150, null, "Cancel Confirm"); } break; case "CancelConfirmed": foreach (GridEditableItem item in RadGrid1.MasterTableView.DetailTables[0].GetItems(GridItemType.EditFormItem)) { if (item.IsInEditMode && item.ItemIndex == (int)Session["savedIndex"]) { item.FireCommandEvent("Cancel", String.Empty); } } // HiddenField1.Value = "false"; break; } } }