This is a migrated thread and some comments may be shown as answers.

[Solved] RadConfirmInGridWithAjax.zip not work in RadWindow

3 Answers 81 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Lee
Top achievements
Rank 2
Lee asked on 03 Jun 2009, 12:34 PM

Hi, All
I had seen http://www.telerik.com/support/kb/aspnet-ajax/grid/replacing-the-default-confirm-dialog-for-radgrid-with-radwindow-confirm.aspx  and tried RadConfirmInGridWithAjax.zip . It works.
However, If the aspx page was displayed in RadWindow, radAjaxManagerObject= undefined

/* some code snips */ 
btnEdit.Attributes["onclick"] = "return ShowForm();";  
function ShowForm()  
   {                  
    window.radopen("View.aspx""MyForm");    /* View.aspx doesn't work when opened by window.radopen */
    return false;   
   }    
 
 
function DoParentCallback()  
      {  
        var parentWindow = window.parent;  
        parentWindow.setTimeout( function()  
        {  
         var radAjaxManagerObject = parentWindow["RadAjaxManager1"];  /* Click DELETE button and click OK when popup window, then Exception:  radAjaxManagerObject: undefined */ 
         radAjaxManagerObject.ajaxRequest("Delete");  
        } , 200);  
      }  
 

download codes:  http://www.lamwz.cn/file/codes/RadConfirmInGrid-Eman.rar

Thanks
Eman

3 Answers, 1 is accepted

Sort by
0
Accepted
Iana Tsolova
Telerik team
answered on 05 Jun 2009, 01:17 PM
Hi Lee,

I can see the you are using RadControls for ASP.NET AJAX. However, the sample you downloaded from the mentioned knowledge base article works with RadControls for ASP.NET. In our case you need the RadConfirmInGrid_Prometheus.zip project. 

For your convenience, I modified your sample directly. Note that RadGrid for ASP.NET AJAX has a property in the GridButtonColumn to select the confirm dialog type.

Additional information on adding delete confirmation in RadGrid is available in the below online resources:
http://www.telerik.com/help/aspnet-ajax/grdaddingdeleteprompt.html
http://www.telerik.com/help/aspnet-ajax/grdconfirmationdialogs.html
 
Regards,
Iana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Lee
Top achievements
Rank 2
answered on 06 Jun 2009, 02:24 AM
Hi,  Iana
Thanks a lot for your help.
I downloaded your attached files and tried.  It works in IE, FF, but not Safari.
Attached files
I added the following codes to perform delete:
 protected void RadGrid1_DeleteCommand(object source, GridCommandEventArgs e) 
    { 
        string ID = (e.Item as GridDataItem).GetDataKeyValue("CustomerID").ToString(); 
        DataTable table = (DataTable)Session["DataSource"]; 
        if (table.Rows.Find(ID) != null
        { 
            table.Rows.Find(ID).Delete(); 
            table.AcceptChanges(); 
            Session["DataSource"] = table; 
        } 
        RadGrid1.Rebind(); 
    } 
download updated codes:   http://www.lamwz.cn/file/codes/133437_radconfirmingrid-eman.rar

Steps to reproduce the issue in Safari 3.0.2 :  

1  Click "Open Default2.aspx in RadWindow"  

2  Click "Delete"

3  Click "OK"  
Notes:  
Work in IE 7, FF 3.0.10  
Not work in Safari 3.0.2 (Click Delete for serval times to Perform Delete : Click Delete - Click OK - Click Detete - Perform delete )

Thanks again.
Eman Lee

0
Accepted
Iana Tsolova
Telerik team
answered on 08 Jun 2009, 01:58 PM
Hello Lee,

I am happy to hear you have found a solution for you case.
I performed further testing on the issue and found that the delete with confirmation for RadGrid does not work in Safari only when the ButtonType of the GridButtonColumn is LinkButton (the default value). So you could choose ImageButton or PushButton type for the delete in order to omit the client code for RadConfirm.

However, I will forward the issue to our developers for further research.

All the best,
Iana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Lee
Top achievements
Rank 2
Answers by
Iana Tsolova
Telerik team
Lee
Top achievements
Rank 2
Share this question
or