I have followed the example that was laid out in previous posts of how to integrate RadControls into Sharepoint and basically, they compile and everything, but when I go to display the webpart, anything that needs to 'fire' doesn't work, e.g. buttons, actions, etc.
So for purposes of demonstrations, I have stripped down to a very basic webpart that simply has only one RadDatePicker in it.
As I said, it will compile and deploy, but when the webpart surfaces the popup button for the calendar doesn't work. In other words clicking on the popup button does nothing, where as if this were not in a webpart the calendar would be displayed.
Can anyone please help me with this, I have been trying various things for several days.
Thanks,
Marshall
So for purposes of demonstrations, I have stripped down to a very basic webpart that simply has only one RadDatePicker in it.
using System;
using System.Runtime.InteropServices;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Serialization;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using Microsoft.SharePoint.WebPartPages;
using Telerik.Web.UI;
namespace InternalControls.WebParts.RadControlTest
{
[Guid("8f913f14-3a18-4287-8444-401611d3cc1f")]
public class WebPart1 : System.Web.UI.WebControls.WebParts.WebPart
{
public WebPart1()
{
}
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
Page.ClientScript.RegisterStartupScript(typeof(WebPart1), this.ID, "_spOriginalFormAction = document.forms[0].action;_spSuppressFormOnSubmitWrapper=true;", true);
if (this.Page.Form != null)
{
string formOnSubmitAtt = this.Page.Form.Attributes["onsubmit"];
if (!string.IsNullOrEmpty(formOnSubmitAtt) && formOnSubmitAtt == "return _spFormOnSubmitWrapper();")
{
this.Page.Form.Attributes["onsubmit"] = "_spFormOnSubmitWrapper();";
}
}
ScriptManager sm = ScriptManager.GetCurrent(this.Page);
if (sm == null)
{
sm = new RadScriptManager();
Controls.AddAt(0, sm);
}
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
Panel panel = new Panel();
panel.ID = "Panel1";
this.Controls.Add(panel);
RadDatePicker rdp = new RadDatePicker();
rdp.PopupDirection = DatePickerPopupDirection.BottomRight;
rdp.Calendar.Enabled = true;
panel.Controls.Add(rdp);
RadAjaxManager ajaxManager = RadAjaxManager.GetCurrent(this.Page);
if (ajaxManager == null)
{
ajaxManager = new RadAjaxManager();
ajaxManager.ID = "RadAjaxManager1";
Controls.Add(ajaxManager);
this.Page.Items.Add(typeof(RadAjaxManager), ajaxManager);
}
ajaxManager.AjaxSettings.AddAjaxSetting(rdp, panel);
}
}
}
As I said, it will compile and deploy, but when the webpart surfaces the popup button for the calendar doesn't work. In other words clicking on the popup button does nothing, where as if this were not in a webpart the calendar would be displayed.
Can anyone please help me with this, I have been trying various things for several days.
Thanks,
Marshall