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

Issue with creating multiple Radwindows programatically.

3 Answers 89 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
srikanth sapelly
Top achievements
Rank 1
srikanth sapelly asked on 01 Dec 2010, 09:08 AM
Hi,

I have a requirement to create mutliple Radwindows in a server control, and opening the radwindow on menu item click event at client side. For testing purpose i have created two radwindows in the page load, added button and textbox events to it, and created a custom attribute to the rad menu item to pass the radwindow id, and calling the radwindow based on the id, but the issue here is
  • Even though i have added the controls for both radwindows, on the menu  item click i am able to see the Radwindow with controls only for menu, for other menu item click the radwindow opening without any content in it.
  • On the button event on the Radwindow, the entire page is getting refrehsed. ( because the radwindow is child control of the page),

so how to handle the scenario to not to refresh the page when the button on radwindow is clicked.

i am using the telerik version : 2010.2.929.35
Thanks,
Srikanth

 

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 01 Dec 2010, 10:57 AM
Hello Srikanth,


I guess you are using RadWindow as container control. You can, instead, load a page in RadWindow by setting the NavigateUrl property of window, so that any postback in the window will not refresh the main page.

And when opening the window, make sure that you opened the correct window by specifying the windowname, in the OnClientItemClicked event of menu.
         var oWnd = radopen (null, "WindowNameHere" );
 


-Shinu.
0
srikanth sapelly
Top achievements
Rank 1
answered on 01 Dec 2010, 11:14 AM
Hi Shinu,
As per our requirement we need create the dynamic radwindow in server control and place it in the page, we dont want to create the radwindow design time.

Thanks,
Srikanth
0
Georgi Tunev
Telerik team
answered on 01 Dec 2010, 12:57 PM
Hello Srikanth,

First of all, I would like to apologize as I accidentally deleted the support ticket you sent on the same subject. I downloaded the project that you sent us in it though, checked it and found the reason for the problem.
In your code, along with the RadWindow, you also create a RadWindowManager - but you already have one, created before. If you remove the commented line in this portion of your code, everything will work as expected:

//..............
 
RadWindow shareThisWindow = new RadWindow();
shareThisWindow.ID = "testWin"+i;
shareThisWindow.Title = "share";
itemShareThis.Attributes.Add("MyCustom", shareThisWindow.ID);
 

shareThisWindow.Attributes.Add("Field", "test value");
TextBox txt = new TextBox();
txt.Text = "hello " + i.ToString();
shareThisWindow.ContentContainer.Controls.Add(txt);
Button btn = new Button();
btn.Text = "Submit";
btn.Click += new EventHandler(btn_Click);
shareThisWindow.ContentContainer.Controls.Add(btn);
 
//mnger = new RadWindowManager(); <-- remove this
mnger.Windows.Add(shareThisWindow);
 
//..........


I hope this helps. Once again I apologize for deleting the ticket.


Regards,
Georgi Tunev
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
General Discussions
Asked by
srikanth sapelly
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
srikanth sapelly
Top achievements
Rank 1
Georgi Tunev
Telerik team
Share this question
or