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

[Solved] Open Rad Window on Grid Error

1 Answer 62 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 23 Sep 2009, 03:25 PM
Ia m trying to open a window when there is an excetion raised.  Per the documentation you can add a control to the bottom of the grid but this is not user friendly and hardly visible in the example:

I can open the window on the client side and set the public variable but can't actually get that value to the client.

******

So I have the public variable for my class:

Public

 

ERR_DESC As String = ""

 

And set this on the Itemupdate() event:

Protected Sub RadGrid1_ItemUpdated(ByVal source As Object, ByVal e As Telerik.Web.UI.GridUpdatedEventArgs) Handles RadGrid1.ItemUpdated
        If Not e.Exception Is Nothing Then
            e.KeepInEditMode = True
            e.ExceptionHandled = True
            ERR_DESC = e.Exception.Message.ToString
        End If
 End Sub

*****

On the client ERR_DESC has the e.Exception.Message.ToString value when it's binding the server side code to the client-side variable but when the client is written the variable is an empty string.

      Sys.Application.add_load(applicationLoadHandler);

      function applicationLoadHandler() {
        debugger;
     
        var ERR_DESC='<%=ERR_DESC%>';
        if (ERR_DESC!='') {
            var oWnd = radopen("RTS_Message_Window.aspx?message="+ERR_DESC+"&title=Problem Running Report" , "RadWindow1" );
            oWnd.setSize (300, 200);
            oWnd.set_behaviors(Telerik.Web.UI.WindowBehaviors.Close);
          }              
        }


What am I missing here??

1 Answer, 1 is accepted

Sort by
0
Accepted
Tsvetoslav
Telerik team
answered on 26 Sep 2009, 07:02 AM
Hi Robert,

Getting server variables on the client is not an easy task - a nice explanation to that is provided in the following blog post:
http://www.west-wind.com/WebLog/posts/252178.aspx

I'd suggest that you use a hidden field instead of a server variable to keep the exception message.

Regards,
Tsvetoslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
Robert
Top achievements
Rank 1
Answers by
Tsvetoslav
Telerik team
Share this question
or