rad window keeps loading on post back

2 posts, 0 answers
  1. Chom
    Chom avatar
    56 posts
    Member since:
    Dec 2009

    Posted 20 Feb 2010 Link to this post

    Hi all

    I have a dilemma with a rad window. Here is an example.

    I have grid and some buttons on a page. I am opening the radwindow from a link button in the grid using the ItemCommand event in code behind.

    Here is the code where I open the radwindow:

     

    Protected Sub rgListingWithImages_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles rgListingWithImages.ItemCommand

     

     

    Dim value As String = Nothing

     

     

    Select Case e.CommandName

     

     

    Case ("DeleteRow")

     

    'Do something here

     

    Exit Select

     

     

     

    Case ("Slides")

     

     

    'Open the slide window

     

     

    'RadWindowManager1.Windows(0).Visible = True

     

     


    Dim
    newWindow As New RadWindow

     

    newWindow.NavigateUrl =

    "http://www.google.com"

     

    newWindow.Top = Unit.Pixel(22)

    newWindow.VisibleOnPageLoad =

    True

     

    newWindow.Left = Unit.Pixel(0)

    RadWindowManager1.Windows.Add(newWindow)

     

    Exit Select

     

     

    End Select

     

     

    End Sub

     

     

     

     


    Here is the problem.

    The window opens OK form the "Select" command of the grid. However when I click on the "Delete" command of the grid the window opens again and when I click on any other button on my page the radwindow opens.

    Is there a way to open the window jsut from the "Select" event of hte grid?

     

  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 22 Feb 2010 Link to this post

    Hello Chommy,

    Since RadControls for ASP.NET AJAX Q3 2009, when a RadWindow is declared in  RadWindowManager it preserves its ViewState which was not so in previous versions. This leads to backwards incompatibility when the VisibleOnPageLoad property is used in this configuration with the idea to show the RadWindow only once. Possible solutions for this case are the following ones:
    •   Set EnableViewState = "false" for the RadWindowManager
    •   Reset the VisibleOnPageLoad property to false with code when suitable, depending on the particular scenario
    •   Show the RadWindow through registering a script from the server instead.


    Greetings,
    Georgi Tunev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top