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

rad window keeps loading on post back

1 Answer 71 Views
Window
This is a migrated thread and some comments may be shown as answers.
Chom
Top achievements
Rank 1
Chom asked on 20 Feb 2010, 10:25 PM
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?

 

1 Answer, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 22 Feb 2010, 02:55 PM
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.
Tags
Window
Asked by
Chom
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or