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

RadWindow Display Issue - Doesn't Display Until Row Click

3 Answers 70 Views
Window
This is a migrated thread and some comments may be shown as answers.
Shawn
Top achievements
Rank 1
Shawn asked on 05 Feb 2009, 09:42 PM
I have a call to display a radwindow alert after a record update in the rad grid 'UpdateCommand' like so:

Protected Sub grid_dealerships_UpdateCommand(ByVal source As ObjectByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles grid_dealerships.UpdateCommand 
 
        Dim editedItem As GridEditableItem = TryCast(e.Item, GridEditableItem) 
        Dim dealer_id As String = editedItem.OwnerTableView.DataKeyValues(editedItem.ItemIndex)("dealer_id"
 
        Try 
            Dim dealer_name As String = (TryCast(editedItem.FindControl("txt_dealer_name"), TextBox)).Text 
 
            Dim logged As Integer = Dealership_DataAccess.UpdateDealershipInformation(dealer_id, dealer_name) 
 
            IF logged > 0 then     
 
                    DisplayMessage(String.Format("Dealership: <br/><br/><b>{0} - {1}</b><br/><br/> Was UPDATED SUCCESSFULLY!", dealer_id, dealer_name), "Dealership UPDATED"
 
            End If 
 
        Catch ex As Exception 
            DisplayMessage("Unable to update dealership record. Reason: " + ex.Message, "Update ERROR"
            e.Canceled = True 
 
        End Try 
 
    End Sub 
 
    Private Sub DisplayMessage(ByVal text As StringByVal title As String
        RadAjaxManager1.ResponseScripts.Add("Sys.Application.add_load(function(){radalert('" & text & "', 330, 210, '" & title & "');})"
    End Sub

Everything regarding the update works properly but the display alert does not show.  If I select a different record on the grid to display or edit then all of a sudden the alert will show up correctly....

Here is my window manager from the aspx page which only displays a radWindow I use for a different purpose.
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"
            <script type="text/javascript"
                function ShowDealerIDs() { 
                    window.radopen("../shared/dealerID_list.aspx""UserListDialog"); 
                    return false; 
                } 
            </script> 
        </telerik:RadCodeBlock>  
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> <AjaxSettings> 
                    <telerik:AjaxSetting AjaxControlID="RadAjaxManager1"
                        <UpdatedControls> 
                            <telerik:AjaxUpdatedControl ControlID="grid_dealerships" /> 
                        </UpdatedControls> 
                    </telerik:AjaxSetting>       
                    <telerik:AjaxSetting AjaxControlID="grid_dealerships"
                        <UpdatedControls> 
                            <telerik:AjaxUpdatedControl ControlID="grid_dealerships" /> 
                        </UpdatedControls> 
                    </telerik:AjaxSetting>                                   
                </AjaxSettings> 
            </telerik:RadAjaxManager> 
 
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server"
    <Windows> 
                    <telerik:RadWindow Skin="Default"  ID="UserListDialog" runat="server" Title="User List Dialog" Height="800px" 
                        Width="550px" Left="100px" ReloadOnShow="true" Modal="true"  /> 
                </Windows> 
    </telerik:RadWindowManager> 

3 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 06 Feb 2009, 01:00 PM
Hi Shawn,

I would suggest to check if the function is really called the first time - you can test this by using a simple alert in it. If the alert shows up as expected, but you still cannot show radalert the first time, please open a support ticket and send us a project that uses your logic and reproduce this behavior. We will check it and do our best to help.


Regards,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Shawn
Top achievements
Rank 1
answered on 09 Feb 2009, 05:36 PM
When I add a simple msgbox before the message I want displayed in the RadWindow it works correctly - like so:
Protected Sub grid_dealerships_UpdateCommand(ByVal source As ObjectByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles grid_dealerships.UpdateCommand  
  
        Dim editedItem As GridEditableItem = TryCast(e.Item, GridEditableItem)  
        Dim dealer_id As String = editedItem.OwnerTableView.DataKeyValues(editedItem.ItemIndex)("dealer_id")  
  
        Try  
            Dim dealer_name As String = (TryCast(editedItem.FindControl("txt_dealer_name"), TextBox)).Text  
  
            Dim logged As Integer = Dealership_DataAccess.UpdateDealershipInformation(dealer_id, dealer_name)  
  
            IF logged > 0 then      
  
MsgBox(String.Format("Dealership: <br/><br/><b>{0} - {1}</b><br/><br/> Was UPDATED SUCCESSFULLY!", dealer_id, dealer_name) 
                     
DisplayMessage(String.Format("Dealership: <br/><br/><b>{0} - {1}</b><br/><br/> Was UPDATED SUCCESSFULLY!", dealer_id, dealer_name), "Dealership UPDATED")  
  
            End If  
  
        Catch ex As Exception  
            DisplayMessage("Unable to update dealership record. Reason: " + ex.Message, "Update ERROR")  
            e.Canceled = True  
  
        End Try  
  
    End Sub  
  
    Private Sub DisplayMessage(ByVal text As StringByVal title As String)  
        RadAjaxManager1.ResponseScripts.Add("Sys.Application.add_load(function(){radalert('" & text & "', 330, 210, '" & title & "');})")  
    End Sub  

Here is what I just discovered actually.  After I get the record to update correctly, the RadWindow that should show the "UPDATED SUCCESSFULLY" msg above actually displays EVERY time I click a row after that has been performed. 

How and why would that occur.  I can expand and collapse any row after update, but each time I do the message for the record I just updated displays...
0
Georgi Tunev
Telerik team
answered on 11 Feb 2009, 01:10 PM
Hello Shawn,

The msgbox is created and shown on the server only. If you try to open that same application from another machine, you will not see the msgbox.
Have you tried what I suggested in my previous reply - to put a standard browser alert in the function and check if it will be called the first time?
If you still experience problems, please open a support ticket and send me a runnable application that I can check. Once I receive it, I will investigate your scenario and provide you with the needed solution.


Greetings,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Window
Asked by
Shawn
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Shawn
Top achievements
Rank 1
Share this question
or