protected override void OnLoad(EventArgs e) |
{ |
base.OnLoad(e); |
|
// TODO: add custom rendering code here. |
Label label = new Label(); |
label.Text = ""; |
this.Controls.Add(label); |
|
/***************************************************** |
* Check for all USERS (Memeber)the in SharePoint Grp. |
****************************************************/ |
|
//allUsers = new DropDownList(); |
allUsers = new RadComboBox(); |
allUsers.ID = "AllUsers"; |
allUsers.Width = 180; |
allUsers.AutoPostBack = true; |
this.Controls.Add(this.allUsers); |
|
// Only create the list items once. On the next postback |
// they will be recreated from the ViewState. |
if (allUsers.Items.Count == 0) |
{ |
//allUsers.Items.Insert(0, new ListItem("--All Members--", "0")); |
allUsers.Items.Insert(0, new RadComboBoxItem("--All Members--", "0")); |
|
foreach (SPUser user in oWeb.Groups["ZIT - Development"].Users) |
{ |
//allUsers.Items.Add(user.LoginName); |
allUsers.Items.Add(new RadComboBoxItem(user.Name)); |
} |
} |
|
theScheduler = new RadScheduler(); |
theScheduler.ID = "TheScheduler"; |
//theScheduler.Skin = "Office2007"; |
theScheduler.Skin = "Vista"; |
|
// Enable the timeline view |
theScheduler.TimelineView.UserSelectable = true; |
theScheduler.Width = new Unit(740, UnitType.Pixel); |
theScheduler.Height = new Unit(650, UnitType.Pixel); |
theScheduler.OverflowBehavior = OverflowBehavior.Expand; |
|
theScheduler.SelectedView = SchedulerViewType.MonthView; |
|
// The following line plus the CSS classes added in the Default.aspx |
// caused the appointments to cross the boundary of the month cell |
theScheduler.MonthView.VisibleAppointmentsPerDay = 5; |
theScheduler.EnableViewState = false; |
|
theScheduler.StartEditingInAdvancedForm = true; |
theScheduler.StartInsertingInAdvancedForm = true; |
|
theScheduler.AllowDelete = false; |
|
/***************************************************************************************** |
* For overriding SharePoint forms (new/edit) and not using RADScheduler new/edit forms. |
*****************************************************************************************/ |
theScheduler.FormCreating += new SchedulerFormCreatingEventHandler(theScheduler_FormCreating); |
theScheduler.TimeSlotCreated += new TimeSlotCreatedEventHandler(theScheduler_TimeSlotCreated); |
|
//Attaching Telerik RADScheduler |
theScheduler.DataSource = GetCalendarItems(); |
|
theScheduler.DataStartField = "StartDate"; |
theScheduler.DataEndField = "EndDate"; |
theScheduler.DataSubjectField = "Title"; |
theScheduler.DataKeyField = "ItemID"; |
|
|
this.Controls.Add(theScheduler); |
|
//allUsers.SelectedIndexChanged += new EventHandler(allUsers_SelectedIndexChanged); |
allUsers.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(allUsers_SelectedIndexChanged); |
|
ajaxManager = RadAjaxManager.GetCurrent(Page); |
if (ajaxManager == null) |
{ |
ajaxManager = new RadAjaxManager(); |
ajaxManager.ID = "RadAjaxManager1"; |
Controls.Add(ajaxManager); |
Page.Items.Add(typeof(RadAjaxManager), ajaxManager); |
|
//For "loading text" while server retrives the filtered name |
|
loadingPanel = new RadAjaxLoadingPanel(); |
loadingPanel.Transparency = 30; |
loadingPanel.BackColor = System.Drawing.Color.LightGray; |
Controls.Add(loadingPanel); |
|
System.Web.UI.WebControls.Image background = new System.Web.UI.WebControls.Image(); |
background.ImageUrl = "http://demos.telerik.com/aspnet-ajax/Ajax/img/loading7.gif"; |
background.BorderWidth = Unit.Pixel(0); |
background.AlternateText = "Loading..."; |
background.Style[HtmlTextWriterStyle.MarginTop] = "50px"; |
loadingPanel.Controls.Add(background); |
|
} |
|
ajaxManager.AjaxSettings.AddAjaxSetting(theScheduler, theScheduler, loadingPanel); |
ajaxManager.AjaxSettings.AddAjaxSetting(allUsers, theScheduler, loadingPanel); |
|
} |