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

[Solved] Using RadWindow with Sharepoint webpart

7 Answers 160 Views
RadControls
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
dhananjay
Top achievements
Rank 1
dhananjay asked on 14 Nov 2006, 04:17 PM
hi,

Can any one help me, how to use Radwindow in sharepoint Webpart.
Note: Radwindow will be popup window

jay

7 Answers, 1 is accepted

Sort by
0
Dimitar Milushev
Telerik team
answered on 20 Nov 2006, 01:31 PM

Hi Dhananjay,

Here is a simple web part code demonstrating opening of a new RadWindow when an ASP.NET button is clicked.

Let us know if you have problems implementing the code.

Sincerely yours,
Dimitar Milushev
the telerik team
0
Arun Kumar
Top achievements
Rank 1
answered on 19 Apr 2009, 05:54 PM
Hi Dimitar Milushev,

Can you please give some example for returning values from RadWindow to a SharePoint Web Part .

Below is the code that i have written and i am getting a javascript error : "OnClientClose" is undefined.

windowManager =

new RadWindowManager();

 

 

// windowManager.RadControlsDir = "/wpresources/RadControls";

 

windowManager.VisibleStatusbar=

false;

 

windowManager.ReloadOnShow =

true;

 

 

 

Button submitButton = new Button();

 

submitButton.Text =

"Show window";

 

submitButton.ID =

"popupButton";

 

refreshName.ContentTemplateContainer.Controls.Add(submitButton);

popupWindow =

new RadWindow();

 

popupWindow.ID =

"RadWindow1";

 

popupWindow.Behaviors=

WindowBehaviors.Close;

 

popupWindow.OnClientClose =

"javascript:OnClientClose(this)";

 

popupWindow.Width =

Unit.Pixel(500);

 

popupWindow.Height =

Unit.Pixel(300);

 

popupWindow.OpenerElementID = submitButton.ClientID;

 

// popupWindow.RadControlsDir = "/wpresources/RadControls";

 

 

ArrayList al = new ArrayList();

 

al.Add(

"A");

 

al.Add(

"B");

 

al.Add(

"C");

 

 

string items = String.Join(",", ((string[])al.ToArray(typeof(String))));

 

 

// Response.Redirect();

 

popupWindow.NavigateUrl =

"/_layouts/PWESearch/SearchCriteria.aspx?items=" + items + "&sDataType=Well";

 

refreshName.ContentTemplateContainer.Controls.Add(popupWindow);

 

//windowManager.Windows.Add(popupWindow);

 

refreshName.ContentTemplateContainer.Controls.Add(windowManager);

 

String OnCloseFunction = @"function OnClientClose(oWnd)

 

{

//get the transferred arguments

alert(oWnd.argument);

var arg = oWnd.argument;

if(arg)

{

alert(arg.searchCriteria);

var searchCriteria = arg;

$get('ctl00_m_g_68b8bae8_7d94_475f_be4e_5d5cfc056505_pnlSearchCriteria').innerHTML = 'You search Criteria is <strong>' + searchCriteria + '</strong>';

}

} "

 

;

 

 

ScriptManager.RegisterStartupScript(this, typeof(SayHelloWebPart), "OnCloseFunction", OnCloseFunction, true);

Please help me in getting over this problem.

Thanks & Regards,
Arun Kumar P

 

0
Georgi Tunev
Telerik team
answered on 21 Apr 2009, 06:49 AM
Hi Arun,

Try setting
popupWindow.OnClientClose ="OnClientClose";
Note that all eventhandlers - OnClientClose, OnClientShow, OnClientPageLoad, etc., accept the name of the function only. The declared function itself automatically gets the RadWindow object as an argument
e.g.
function OnClientClose(oWnd)
{
  //your code here
}


Best wishes,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Alexandre
Top achievements
Rank 1
answered on 15 Nov 2010, 11:03 AM
Hi!

   I am trying to use RadWindow on a SharePoint web part, but the code that is attached on this thread is not working (the popup is just nor firing)
  Also I saw that some attributes (like RadControlsDir) doesn't exists on the version that I am using - RadControls for ASP.NET AJAX Q1 2010

  Is there any change to provide an up to date example?


Tks,

Alex
0
Georgi Tunev
Telerik team
answered on 15 Nov 2010, 12:32 PM
Hello Alex,

This thread is quite old (from 2006) and it is related to the ASP.NET edition of the RadWindow control - that is why some of the properties are missing.
As for the code, could you please post it again, so I can check it?


Best wishes,
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
0
Alexandre
Top achievements
Rank 1
answered on 19 Nov 2010, 06:10 PM
Hey Georgi,

  I was rechecking the code attached to this thread and it really worked. I just mixed the attribute "ClientID" with "ID". My only issue now is that the button will fire the radwindow every time it is clicked.

  I would like to put some business logic on my button code, and depending on one condition of my logic the rad window would show up or not.
  
  Is that possible?

Tks,

Alex
0
Fiko
Telerik team
answered on 24 Nov 2010, 02:11 PM
Hi Alexandre,

In your case I recommend you to use this approach in order to open a new RadWindow (radalert is an RadWidnow) from the server.

Greetings,
Fiko
the Telerik team
See the rest of the Telerik controls that can be integrated in SharePoint 2007/2010 on this page. To watch them in action, explore our online SharePoint 2010 and SharePoint 2007 demo sites.
Tags
RadControls
Asked by
dhananjay
Top achievements
Rank 1
Answers by
Dimitar Milushev
Telerik team
Arun Kumar
Top achievements
Rank 1
Georgi Tunev
Telerik team
Alexandre
Top achievements
Rank 1
Fiko
Telerik team
Share this question
or