<rad:RadToolBar Font-Size="Smaller" Width="95px" ID="RadtoolbarScroll" runat="server"
AutoPostBack="True" Skin="Outlook" UseFadeEffect="True">
<Items>
<rad:RadToolBarButton runat="server" Text="btnChkScroll">
<ItemTemplate>
<asp:CheckBox ID="chkScroll" runat="server" Width="19px" Font-Size="Smaller" />
</ItemTemplate>
</rad:RadToolBarButton>
<rad:RadToolBarButton>
<ItemTemplate>
<asp:Label ID="lblScroll" Width="47px" runat="server" Text="Scroll" Font-Bold="true"
Font-Size="Smaller" EnableViewState="false"></asp:Label>
</ItemTemplate>
</rad:RadToolBarButton>
</Items>
</rad:RadToolBar>
<
Telerik:RadWindowManager
ID="RadWindowManager1"
runat="server">
<Windows>
<telerik:RadWindow ID="RadWindowError"
runat="server"
Visible="false"
Modal="true">
<asp:Label ID="labelResult" runat="server"></asp:Label>
</telerik:RadWindow>
</Windows>
</Telerik:RadWindowManager>
| <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="MYItem.ascx.cs" Inherits="MY.UserControls.MYItem" %> | |
| <%@ Register Assembly="RadDock.Net2" Namespace="Telerik.WebControls" TagPrefix="rad" %> | |
| <%@ Register TagPrefix="radcb" Namespace="Telerik.WebControls" Assembly="RadComboBox.NET2" %> | |
| <rad:RadDockingManager ID="RadDockingManager1" runat="server" /> | |
| <rad:RadDockingZone ID="RadDockingZone1" runat="server"> | |
| <rad:RadDockableObject ID="RadDockableObject1" runat="server"> | |
| <ContentTemplate> | |
| <asp:Panel ID="PanelConfig" runat="server" Visible="false"> | |
| <radcb:radcombobox MarkFirstMatch="true" AllowCustomText="false" Sort="Descending" id="RadComboBox1" Skin="Default" Width="300px" AutoPostBack="false" RadComboBoxImagePosition="Right" Height="140px" Runat="server"></radcb:radcombobox> | |
| <asp:Button id="Button1" runat="server" Text="Select" OnClick="Button1_Click" CssClass="CommandButton"></asp:Button> | |
| <br /><br /> | |
| </asp:Panel> | |
| <iframe id="iframeGrid" height="417px" width="655px" frameborder="0" scrolling="yes" runat="server" src="~/utils/pleasewait.aspx"></iframe> | |
| </ContentTemplate> | |
| <Commands> | |
| <rad:RadDockableObjectCommand AutoPostBack="true" Image="../images/icon_edit.gif" Name="edit"></rad:RadDockableObjectCommand> | |
| <rad:RadDockableObjectCommand AutoPostBack="true" Image="../images/icon_clsdfold.gif" Name="closeedit" /> | |
| </Commands> | |
| </rad:RadDockableObject> | |
| </rad:RadDockingZone> | |
| using System; | |
| using System.Runtime.InteropServices; | |
| using System.Web.UI; | |
| using System.Web.UI.WebControls.WebParts; | |
| using System.Xml.Serialization; | |
| using Microsoft.SharePoint; | |
| using Microsoft.SharePoint.WebControls; | |
| using Microsoft.SharePoint.WebPartPages; | |
| using System.ComponentModel; | |
| namespace MY.Parts | |
| { | |
| [DefaultProperty("Text"), | |
| ToolboxData("<{0}:MYWP runat=server></{0}:MYWP>"), | |
| XmlRoot(Namespace = "MY.Parts")] | |
| public class MYWP : Microsoft.SharePoint.WebPartPages.WebPart | |
| { | |
| private const string defaultText = ""; | |
| private string _userControl = defaultText; | |
| private Control _control = null; | |
| private ScriptManager _AjaxManager; | |
| [Browsable(true), | |
| Category("User Control"), | |
| DefaultValue(defaultText), | |
| WebPartStorage(Storage.Personal), | |
| FriendlyName("User Control (.ascx)"), | |
| Description("Path to the User Control (.ascx)")] | |
| public string UserControl | |
| { | |
| get | |
| { | |
| return _userControl; | |
| } | |
| set | |
| { | |
| _userControl = value; | |
| } | |
| } | |
| public MYWP() | |
| { | |
| this.ExportMode = WebPartExportMode.All; | |
| } | |
| protected override void CreateChildControls() | |
| { | |
| base.CreateChildControls(); | |
| try | |
| { | |
| if ((this._control == null) && (this.Page != null)) | |
| { | |
| try | |
| { | |
| if (_userControl != defaultText) | |
| { | |
| if ((this._userControl != "") && (this._userControl.IndexOf("~") != -1)) | |
| { | |
| thisthis._control = this.Page.LoadControl(this._userControl); | |
| } | |
| } | |
| else | |
| { | |
| _control = new LiteralControl(string.Format("To link to content, <a href=\"javascript:MSOTlPn_ShowToolPaneWrapper('{0}','{1}','{2}');\">open the tool pane</a> and then type a URL in the Link text box.", 1, 129, this.ID)); | |
| } | |
| } | |
| catch (Exception exception) | |
| { | |
| this._control = new LiteralControl(string.Format("<b>Error:</b> unable to load {0}<br /><b>Details:</b> {1}", this._userControl, exception.Message)); | |
| } | |
| } | |
| } | |
| catch (System.Exception ex) | |
| { | |
| _control = new LiteralControl(string.Format("<b>Error:</b> unable to load {0}<br /><b>Details:</b> {1}", _userControl, ex.Message)); | |
| } | |
| if (_control != null) | |
| { | |
| // Add to the Controls collection to support postback | |
| this.Controls.Add(_control); | |
| } | |
| } | |
| protected override void RenderWebPart(HtmlTextWriter output) | |
| { | |
| EnsureChildControls(); | |
| if (_control != null) | |
| { | |
| _control.RenderControl(output); | |
| } | |
| } | |
| protected override void OnInit(EventArgs e) | |
| { | |
| try | |
| { | |
| base.OnInit(e); | |
| this._AjaxManager = ScriptManager.GetCurrent(this.Page); | |
| if (this._AjaxManager == null) | |
| { | |
| this._AjaxManager = new ScriptManager(); | |
| this._AjaxManager.EnablePartialRendering = true; | |
| this._AjaxManager.EnableScriptLocalization = true; | |
| this.Page.ClientScript.RegisterStartupScript(typeof(MYWP), this.ID, "_spOriginalFormAction = document.forms[0].action;", true); | |
| if (this.Page.Form != null) | |
| { | |
| string str = this.Page.Form.Attributes["onsubmit"]; | |
| if (!string.IsNullOrEmpty(str) && (str == "return _spFormOnSubmitWrapper();")) | |
| { | |
| this.Page.Form.Attributes["onsubmit"] = "_spFormOnSubmitWrapper();"; | |
| } | |
| try | |
| { | |
| this.Page.Form.Controls.AddAt(0, this._AjaxManager); | |
| } | |
| catch (Exception ex) | |
| { | |
| this.Controls.AddAt(0, this._AjaxManager); | |
| } | |
| } | |
| } | |
| } | |
| catch (Exception ex) | |
| { | |
| } | |
| } | |
| [WebPartStorage(Storage.None)] | |
| public ScriptManager AjaxManager | |
| { | |
| get | |
| { | |
| return this._AjaxManager; | |
| } | |
| set | |
| { | |
| this._AjaxManager = value; | |
| } | |
| } | |
| } | |
| } | |