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

RadWindow - Base Part

1 Answer 41 Views
Sharepoint Integration
This is a migrated thread and some comments may be shown as answers.
Lucas
Top achievements
Rank 1
Lucas asked on 04 Apr 2009, 05:42 PM
I have developed a quick base part for using the radwindowmanager on a sharepoint site.  My requirement was to have various webparts that could open a rad window from links, such as news and events.  Here is my base class.   What do you think? The skin is hardcoded, but that could easily be changed.  I have found that this seems to work pretty well for what I am trying to do. 

using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI;
using System.Reflection;
using Telerik.Web.UI;
using Telerik.Charting.Styles;

namespace SunGard.Portal.WebParts.Controls {
    public class BaseWindowPart : System.Web.UI.WebControls.WebParts.WebPart {
        private const string javascriptIncludeKey = "SunGardPortalWebPartsClientScript";
        private const string javascriptFilePath = "SunGardPortalWebPartsClientScript.js";
        private RadWindowManager windowManager;
        private RadWindow popupWindow;

        protected string radWindowClientName = "SPRadWindow";

        protected override void OnLoad(EventArgs e) {
            ClientScriptManager cs = Page.ClientScript;
            if (!cs.IsClientScriptIncludeRegistered(typeof(Page), javascriptIncludeKey)) {
                string scriptUrl = cs.GetWebResourceUrl(this.GetType(), String.Format("{0}.{1}", Assembly.GetExecutingAssembly().GetName().Name, javascriptFilePath));
                cs.RegisterClientScriptInclude(typeof(Page), javascriptIncludeKey, scriptUrl);
            }
            base.OnLoad(e);
        }

        protected override void CreateChildControls() {
            base.CreateChildControls();
            if (Page.FindControl("SPRadWindow") == null) {
                windowManager = new RadWindowManager();
                windowManager.ID = "SPRadWindow";
                windowManager.Skin = "WebBlue";

                Controls.Add(windowManager);
                popupWindow = new RadWindow();
                popupWindow.ReloadOnShow = true;
                Controls.Add(popupWindow);
            }
        }
    }}

1 Answer, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 07 Apr 2009, 11:08 AM
Hello Lucas,

The code seems OK and you should not experience problems with it. Of course if any problem arise, we are ready to help you with it.

Greetings,
Georgi Tunev
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
Sharepoint Integration
Asked by
Lucas
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or