I tried surrounding the rsAvOptionsScroll div in the AdvancedForm with a UpdatePanel:
<asp:UpdatePanel ID="updtAdvFormControls" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false">
<ContentTemplate>
Then I tried dropping a standard Button and a RadTextBox on the form:
<asp:Button ID="btnResetSearch" runat="server" Text="Reset" OnClick="AddTeamMember2" Style="text-align: center;" />
<telerik:RadTextBox ID="RadTextBox1" runat="server">
</telerik:RadTextBox>
After that I created the callback function:
protected void AddTeamMember2(object sender, EventArgs e)
{
RadTextBox1.Text = "hhh";
updtAdvFormControls.Update();
}
When I clicked on the button the debugger goes into the AddTeamMember2 function
but the RadTextBox1 never gets set to "hhh" after it you hit F5 to continue. If I type in
"xxx" in the RadTextBox1 from the screen and then take the debugger back into the
AddTeamMember2 function, the value is set to "xxx" and latter gets set to "hhh" but
after hitting F5 to continue the screen always says "xxx".
Thanks,
Kip
23 Answers, 1 is accepted
Can you open a support ticket and send us a stripped down working version of your project which we can test locally? There are some unknowns regarding this scenario so it would be best if we can take a look directly at your implementation.
Best wishes,
Peter
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.
| <%-- =========================================================================================================== --> <%-- ================================== Here's the Markup for KIP.aspx ========================================= --> <%-- =========================================================================================================== --> <%@ Page Title="" Language="C#" MasterPageFile="~/Main.master" AutoEventWireup="true" CodeFile="KIP.aspx.cs" Inherits="_Dev_KIP" %> |
| <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
| <%--<%@ Register TagPrefix="sds" Namespace="Telerik.Web.SessionDS" %>--%> |
| <%@ Register TagPrefix="scheduler" TagName="AdvancedForm" Src="~/Cntrls/AdvancedForm.ascx" %> |
| <asp:Content ID="Content1" ContentPlaceHolderID="Content" Runat="Server"> |
| <asp:ScriptManagerProxy ID="smpCustomScripts2" runat="server"> |
| <CompositeScript ScriptMode="Release"> |
| <Scripts> |
| <%--Needed because combining script managers throws an error...--%> |
| <asp:ScriptReference Path="~/_assets/scripts/AdvancedForm.js" /> |
| </Scripts> |
| </CompositeScript> |
| </asp:ScriptManagerProxy> |
| <div class="dodropshadow ContentBox" style="width: 800px;"> |
| <div class="ContentBox-Header"> |
| </div> |
| <div class="Contents"> |
| <%-- <asp:ScriptManager ID="ScriptManager1" runat="server"> |
| </asp:ScriptManager> |
| <telerik:RadScheduler ID="RadScheduler1" runat="server" ProviderName="ReadOnlySchedulerData" ReadOnly="false"> |
| </telerik:RadScheduler> |
| --%> |
| <%--<telerik:RadScriptManager runat="server" ID="RadScriptManager1" />--%> |
| <%-- |
| <telerik:RadScriptManager runat="server" ID="RadScriptManager1"> |
| <scripts> |
| <asp:ScriptReference Path="../_assets/scripts/AdvancedForm.js" /> |
| </scripts> |
| </telerik:RadScriptManager> |
| --%> |
| <script type="text/javascript"> |
| //<![CDATA[ |
| function schedulerFormCreated(scheduler, eventArgs) { |
| var $ = $telerik.$; |
| var schedulerElement = scheduler.get_element(); |
| var formElement = $("div.rsAdvancedEdit", schedulerElement); |
| var isModal = scheduler.get_advancedFormSettings().modal; |
| if (formElement.length == 1) { |
| // Initialize the client-side object for the advanced form |
| var advancedTemplate = new window.SchedulerAdvancedTemplate(schedulerElement, formElement[0], isModal); |
| advancedTemplate.initialize(); |
| } |
| } |
| //]]> |
| </script> |
| <%-- <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> |
| <AjaxSettings> |
| <telerik:AjaxSetting AjaxControlID="RadScheduler1"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| </AjaxSettings> |
| </telerik:RadAjaxManager> |
| <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />--%> |
| <div class="bigModule"> |
| <div class="bigModuleBottom"> |
| This example demonstrates how to build a custom database provider for <strong>RadScheduler</strong>. |
| <br /> |
| The source code for the provider is located in the App_Code directory of the QSF. |
| <br /> |
| Please, refer to the documentation for information about implementing your own providers. |
| </div> |
| </div> |
| <telerik:RadComboBox ID="RadComboBox2" runat="server" Skin="WebBlue" AutoPostBack="True"> |
| <Items> |
| <telerik:RadComboBoxItem runat="server" Selected="True" Text="None" /> |
| <telerik:RadComboBoxItem runat="server" Text="Type" Value="Type" /> |
| <telerik:RadComboBoxItem runat="server" Text="Priority" Value="Priority" /> |
| <telerik:RadComboBoxItem runat="server" Text="Client" Value="Client" /> |
| </Items> |
| </telerik:RadComboBox> |
| <telerik:RadScheduler runat="server" ID="RadScheduler1" Width="750px" SelectedView="WeekView" SelectedDate="2007-08-02" |
| ProviderName="ReadOnlySchedulerData" CustomAttributeNames="Description,Attendees,AttendeesID,Clients,ClientsID" TimeZoneOffset="03:00:00" |
| OnAppointmentCreated="RadScheduler1_AppointmentCreated" HoursPanelTimeFormat="htt" |
| ValidationGroup="RadScheduler1" Skin="WebBlue" OnClientFormCreated="schedulerFormCreated"> |
| <Localization AdvancedAllDayEvent="All Day Event"></Localization> |
| <AdvancedForm Modal="true" /> |
| <AdvancedEditTemplate> |
| <scheduler:AdvancedForm runat="server" ID="AdvancedEditForm1" Mode="Edit" Subject='<%# Bind("Subject") %>' |
| Start='<%# Bind("Start") %>' End='<%# Bind("End") %>' RecurrenceRuleText='<%# Bind("RecurrenceRule") %>' |
| Description='<%# Bind("Description") %>' TypeID='<%# Bind("Type") %>' |
| Attendees='<%# Bind("Attendees") %>' AttendeesID='<%# Bind("AttendeesID") %>' |
| Clients='<%# Bind("Clients") %>' ClientsID='<%# Bind("ClientsID") %>' |
| PriorityID='<%# Bind("Priority") %>' /> |
| </AdvancedEditTemplate> |
| <AdvancedInsertTemplate> |
| <scheduler:AdvancedForm runat="server" ID="AdvancedInsertForm1" Mode="Insert" Subject='<%# Bind("Subject") %>' |
| Start='<%# Bind("Start") %>' End='<%# Bind("End") %>' RecurrenceRuleText='<%# Bind("RecurrenceRule") %>' |
| Description='<%# Bind("Description") %>' TypeID='<%# Bind("Type") %>' |
| Attendees='<%# Bind("Attendees") %>' AttendeesID='<%# Bind("AttendeesID") %>' |
| Clients='<%# Bind("Clients") %>' ClientsID='<%# Bind("ClientsID") %>' |
| PriorityID='<%# Bind("Priority") %>' /> |
| </AdvancedInsertTemplate> |
| <AppointmentTemplate> |
| <div id="subject" style="font-size:10px; vertical-align:bottom; padding-bottom:1px; "> |
| <asp:Label runat="server" ID="RecurrenceIcon" /> |
| <%# Eval("Subject") %> |
| </div> |
| <asp:Label runat="server" ID="Type" Font-Size="10px" /> |
| <br /> |
| <asp:Label runat="server" ID="Priority" Font-Size="10px" /> |
| <br /> |
| <asp:Label runat="server" ID="Clients" Font-Size="10px" /> |
| </AppointmentTemplate> |
| <TimelineView UserSelectable="false" /> |
| </telerik:RadScheduler> |
| </div> |
| <div class="Footer"> |
| </div> |
| </div> |
| </asp:Content> |
| // =========================================================================================================== |
| // ================================== Here's the Code for KIP.cs ============================================= |
| // =========================================================================================================== |
| using System; |
| using System.Collections.Generic; |
| using System.Linq; |
| using System.Web; |
| using System.Web.UI; |
| using System.Web.UI.WebControls; |
| using Telerik.Web.UI; |
| public partial class _Dev_KIP : BasePage |
| { |
| protected void Page_Load(object sender, EventArgs e) |
| { |
| RadScheduler1.GroupBy = RadComboBox2.SelectedValue; |
| } |
| protected void RadScheduler1_AppointmentCreated(object sender, AppointmentCreatedEventArgs e) |
| { |
| if (e.Appointment.Resources.GetResourceByType("Priority") != null) |
| { |
| switch (e.Appointment.Resources.GetResourceByType("Priority").Text) |
| { |
| case "High": |
| e.Appointment.CssClass = "rsCategoryRed"; |
| //e.Appointment.CssClass = "MyCustomAppointmentStyle"; |
| break; |
| case "Low": |
| e.Appointment.CssClass = "rsCategoryBlue"; |
| //e.Appointment.CssClass = ""; |
| break; |
| default: |
| e.Appointment.CssClass = "rsCategoryBlue"; |
| //e.Appointment.CssClass = ""; |
| break; |
| } |
| } |
| Label recurrenceIcon = (Label)e.Container.FindControl("RecurrenceIcon"); |
| if (e.Appointment.RecurrenceState != RecurrenceState.NotRecurring) |
| { |
| if (e.Appointment.RecurrenceState == RecurrenceState.Exception) |
| { |
| recurrenceIcon.CssClass = "rsAptRecurrenceException"; |
| } |
| else |
| { |
| recurrenceIcon.CssClass = "rsAptRecurrence"; |
| } |
| } |
| else |
| { |
| recurrenceIcon.Visible = false; |
| } |
| Resource type = e.Appointment.Resources.GetResourceByType("Type"); |
| if (type != null) |
| { |
| //e.Appointment.ToolTip = string.Format("You can reach {0} at {1}.", type.Text, type.Attributes["Phone"]); |
| e.Appointment.ToolTip = string.Format("Appointment type is {0}.", type.Text); |
| Label typeLabel = (Label)e.Container.FindControl("Type"); |
| typeLabel.Text = "Type: " + type.Text; |
| } |
| else |
| { |
| Label typeLabel = (Label)e.Container.FindControl("Type"); |
| typeLabel.Text = "Type: none"; |
| } |
| Resource priority = e.Appointment.Resources.GetResourceByType("Priority"); |
| if (priority != null) |
| { |
| Label priorityLabel = (Label)e.Container.FindControl("Priority"); |
| priorityLabel.Text = "Priority: " + priority.Text; ; |
| } |
| else |
| { |
| Label priorityLabel = (Label)e.Container.FindControl("Priority"); |
| priorityLabel.Text = "Priority: none"; |
| } |
| Label clients = (Label)e.Container.FindControl("Clients"); |
| int clientsCount = 0; |
| foreach (Resource client in e.Appointment.Resources.GetResourcesByType("Client")) |
| { |
| clientsCount++; |
| } |
| clients.Text = clientsCount.ToString() + " client(s)"; |
| } |
| } |
| <%-- =========================================================================================================== --> <%-- ================================== Here's the Markup for AdvancedForm.ascx ================================ --> <%-- =========================================================================================================== --> <%@ Control Language="C#" AutoEventWireup="true" CodeFile="AdvancedForm.ascx.cs" Inherits="SchedulerTemplatesCS.AdvancedForm" %> |
| <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> |
| <%@ Register TagPrefix="scheduler" TagName="CustomAttributeControl" Src="CustomAttributeControl.ascx" %> |
| <%@ Register TagPrefix="scheduler" TagName="ResourceControl" Src="ResourceControl.ascx" %> |
| <%@ Register TagPrefix="scheduler" TagName="MultipleValuesResourceControl" Src="MultipleValuesResourceControl.ascx" %> |
| <%@ Register Src="UserSearch.ascx" TagName="UserSearch" TagPrefix="uc2" %> |
| <div class="rsAdvancedEdit" style="position: relative"> |
| <%-- Title bar. --%> |
| <div class="rsAdvTitle"> |
| <%-- The rsAdvInnerTitle element is used as a drag handle when the form is modal. --%> |
| <h1 class="rsAdvInnerTitle"> |
| <%# Owner.Localization.AdvancedEditAppointment %></h1> |
| <asp:LinkButton runat="server" ID="AdvancedEditCloseButton" CssClass="rsAdvEditClose" CommandName="Cancel" CausesValidation="false" ToolTip='<%# Owner.Localization.AdvancedClose %>'> |
| <%# Owner.Localization.AdvancedClose %> |
| </asp:LinkButton> |
| </div> |
| <div class="rsAdvContentWrapper"> |
| <%-- Scroll container - when the form height exceeds MaximumHeight scrollbars will appear on this element--%> |
| <asp:UpdatePanel ID="updtAdvFormControls" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false"> |
| <ContentTemplate> |
| <div class="rsAdvOptionsScroll"> |
| <asp:Panel runat="server" ID="AdvancedEditOptionsPanel" CssClass="rsAdvOptions"> |
| <asp:Panel runat="server" ID="BasicControlsPanel" CssClass="rsAdvBasicControls" OnDataBinding="BasicControlsPanel_DataBinding"> |
| <telerik:RadTextBox runat="server" ID="SubjectText" TextMode="MultiLine" Columns="50" Rows="1" Width="100%" Label='<%# Owner.Localization.AdvancedSubject + ":" %>' Text='<%# Eval("Subject") %>' /> |
| <asp:RequiredFieldValidator runat="server" ID="SubjectValidator" ControlToValidate="SubjectText" EnableClientScript="true" Display="None" CssClass="rsValidatorMsg" /> |
| <br /> |
| <asp:Button ID="btnAddTeamMember" runat="server" Text="Add Team Member" SkinID="Icon_Clients_S" /> |
| <ajx:ModalPopupExtender ID="btnAddTeamMember_ModalPopupExtender" runat="server" BackgroundCssClass="modalBackground" DynamicServicePath="" Enabled="True" PopupControlID="pnlModalPopup" TargetControlID="btnAddTeamMember" BehaviorID="pnlModalPopupBehavior" /> |
| <asp:Image ID="imgIconAddAttendee" runat="server" SkinID="Icon_Clients_S" Width="10px" /> |
| <telerik:RadTextBox runat="server" ID="AttendeesText" TextMode="MultiLine" Columns="70" Rows="2" Label="Attendees: " Text='<%# Eval("Attendees") %>' /> |
| <telerik:RadTextBox runat="server" ID="AttendeesIDText" TextMode="MultiLine" Columns="60" Rows="2" Text='<%# Eval("AttendeesID") %>' /> |
| <telerik:RadTextBox ID="RadTextBox1" runat="server"> |
| </telerik:RadTextBox> |
| <asp:Button ID="btnResetSearch" runat="server" Text="Reset" OnClick="AddTeamMember2" Style="text-align: center;" /> |
| <br /> |
| <asp:Image ID="imgIconAddClient" runat="server" SkinID="Icon_Clients_S" Width="10px" /> |
| <telerik:RadTextBox runat="server" ID="ClientsText" TextMode="MultiLine" Columns="70" Rows="2" Label="Clients: " Text='<%# Eval("Clients") %>' /> |
| <telerik:RadTextBox runat="server" ID="ClientsIDText" TextMode="MultiLine" Columns="60" Rows="2" Text='<%# Eval("ClientsID") %>' /> |
| <ul class="rsTimePickers"> |
| <li class="rsTimePick"> |
| <label for='<%# StartDate.ClientID %>_dateInput_text'> |
| <%# Owner.Localization.AdvancedFrom %></label><%-- |
| Leaving a newline here will affect the layout, so we use a comment instead. |
| --%><telerik:RadDatePicker runat="server" ID="StartDate" CssClass="rsAdvDatePicker" Width="83px" SharedCalendarID="SharedCalendar" Skin='<%# Owner.Skin %>' Culture='<%# Owner.Culture %>' MinDate="1900-01-01"> |
| <DatePopupButton Visible="False" /> |
| <DateInput ID="DateInput2" runat="server" DateFormat='<%# Owner.AdvancedForm.DateFormat %>' EmptyMessageStyle-CssClass="radInvalidCss_Default" EmptyMessage=" " /> |
| </telerik:RadDatePicker> |
| <%-- |
| --%><telerik:RadTimePicker runat="server" ID="StartTime" CssClass="rsAdvTimePicker" Width="65px" Skin='<%# Owner.Skin %>' Culture='<%# Owner.Culture %>'> |
| <DateInput ID="DateInput3" runat="server" EmptyMessageStyle-CssClass="radInvalidCss_Default" EmptyMessage=" " /> |
| <TimePopupButton Visible="false" /> |
| <TimeView ID="TimeView1" runat="server" Columns="2" ShowHeader="false" StartTime="08:00" EndTime="18:00" Interval="00:30" /> |
| </telerik:RadTimePicker> |
| </li> |
| <li class="rsTimePick"> |
| <label for='<%# EndDate.ClientID %>_dateInput_text'> |
| <%# Owner.Localization.AdvancedTo%></label><%-- |
| --%><telerik:RadDatePicker runat="server" ID="EndDate" CssClass="rsAdvDatePicker" Width="83px" SharedCalendarID="SharedCalendar" Skin='<%# Owner.Skin %>' Culture='<%# Owner.Culture %>' MinDate="1900-01-01"> |
| <DatePopupButton Visible="False" /> |
| <DateInput ID="DateInput4" runat="server" DateFormat='<%# Owner.AdvancedForm.DateFormat %>' EmptyMessageStyle-CssClass="radInvalidCss_Default" EmptyMessage=" " /> |
| </telerik:RadDatePicker> |
| <%-- |
| --%><telerik:RadTimePicker runat="server" ID="EndTime" CssClass="rsAdvTimePicker" Width="65px" Skin='<%# Owner.Skin %>' Culture='<%# Owner.Culture %>'> |
| <DateInput ID="DateInput5" runat="server" EmptyMessageStyle-CssClass="radInvalidCss_Default" EmptyMessage=" " /> |
| <TimePopupButton Visible="false" /> |
| <TimeView ID="TimeView2" runat="server" Columns="2" ShowHeader="false" StartTime="08:00" EndTime="18:00" Interval="00:30" /> |
| </telerik:RadTimePicker> |
| </li> |
| <li class="rsAllDayWrapper"> |
| <asp:CheckBox runat="server" ID="AllDayEvent" CssClass="rsAdvChkWrap" Checked="false" TextAlign="Left" /> |
| </li> |
| </ul> |
| <asp:RequiredFieldValidator runat="server" ID="StartDateValidator" ControlToValidate="StartDate" EnableClientScript="true" Display="None" CssClass="rsValidatorMsg" /> |
| <asp:RequiredFieldValidator runat="server" ID="StartTimeValidator" ControlToValidate="StartTime" EnableClientScript="true" Display="None" CssClass="rsValidatorMsg" /> |
| <asp:RequiredFieldValidator runat="server" ID="EndDateValidator" ControlToValidate="EndDate" EnableClientScript="true" Display="None" CssClass="rsValidatorMsg" /> |
| <asp:RequiredFieldValidator runat="server" ID="EndTimeValidator" ControlToValidate="EndTime" EnableClientScript="true" Display="None" CssClass="rsValidatorMsg" /> |
| <asp:CustomValidator runat="server" ID="DurationValidator" ControlToValidate="StartDate" EnableClientScript="false" Display="Dynamic" CssClass="rsValidatorMsg rsInvalid" OnServerValidate="DurationValidator_OnServerValidate" /> |
| </asp:Panel> |
| <asp:Panel runat="server" ID="AdvancedControlsPanel" CssClass="rsAdvMoreControls"> |
| <asp:Panel runat="server" ID="CustomAttributeControls"> |
| <%-- CUSTOM ATTRIBUTE CONTROLS --%> |
| <ul class="rsAttributeControls"> |
| <li> |
| <%-- <scheduler:CustomAttributeControl |
| runat="server" ID="CustomAttributeControls1" |
| Label="Annotation:" Value='<%# Bind("Annotations") %>' /> |
| --%> |
| </li> |
| <!-- Optionally add more CustomAttributeControl instances here --> |
| </ul> |
| </asp:Panel> |
| <asp:Panel runat="server" ID="ResourceControls"> |
| <%-- RESOURCE CONTROLS --%> |
| <ul class="rsResourceControls"> |
| <li> |
| <scheduler:ResourceControl runat="server" ID="ResourceControl1" Type="Type" Label="Type:" Value='<%# Bind("Type") %>' Skin='<%# Owner.Skin %>' /> |
| </li> |
| <li> |
| <scheduler:ResourceControl runat="server" ID="ResourceControl3" Type="Priority" Label="Priority:" Value='<%# Bind("Priority") %>' Skin='<%# Owner.Skin %>' /> |
| </li> |
| <li> |
| <scheduler:MultipleValuesResourceControl runat="server" ID="ResourceControl2" Type="Client" Label="Client: " Value='<%# Bind("Client") %>' /> |
| </li> |
| <!-- Optionally add more ResourceControl instances here --> |
| </ul> |
| </asp:Panel> |
| </asp:Panel> |
| <telerik:RadTextBox runat="server" ID="DescriptionText" TextMode="MultiLine" Columns="50" Rows="5" Width="100%" Label="Description" Text='<%# Eval("Description") %>' /> |
| <asp:Panel runat="server" ID="RecurrenceCheckBoxPanel"> |
| <asp:CheckBox runat="server" ID="RecurrentAppointment" CssClass="rsAdvChkWrap" Checked="false" Style="float: none" /> |
| </asp:Panel> |
| <asp:Panel runat="server" ID="RecurrencePanel" Style="display: none;" CssClass="rsAdvRecurrencePanel"> |
| <asp:Panel runat="server" ID="RecurrencePatternPanel" CssClass="rsAdvRecurrencePatterns" OnDataBinding="RecurrencePatternPanel_DataBinding"> |
| <span class="rsAdvResetExceptions"> |
| <asp:LinkButton runat="server" ID="ResetExceptions" OnClick="ResetExceptions_OnClick" /> |
| </span> |
| <asp:Panel runat="server" ID="RecurrenceFrequencyPanel" CssClass="rsAdvRecurrenceFreq"> |
| <ul class="rsRecurrenceOptionList"> |
| <li> |
| <asp:RadioButton runat="server" GroupName="RepeatFrequency" ID="RepeatFrequencyHourly" /></li> |
| <li> |
| <asp:RadioButton runat="server" GroupName="RepeatFrequency" ID="RepeatFrequencyDaily" /></li> |
| <li> |
| <asp:RadioButton runat="server" GroupName="RepeatFrequency" ID="RepeatFrequencyWeekly" /></li> |
| <li> |
| <asp:RadioButton runat="server" GroupName="RepeatFrequency" ID="RepeatFrequencyMonthly" /></li> |
| <li> |
| <asp:RadioButton runat="server" GroupName="RepeatFrequency" ID="RepeatFrequencyYearly" /></li> |
| </ul> |
| </asp:Panel> |
| <asp:Panel runat="server" ID="RecurrencePatternHourlyPanel" CssClass="rsAdvPatternPanel rsAdvHourly" Style="display: none;"> |
| <div> |
| <%# Owner.Localization.AdvancedEvery %> |
| <telerik:RadNumericTextBox runat="server" CssClass="rsAdvInput" Width="50px" ID="HourlyRepeatInterval" Value="1" Type="Number" NumberFormat-DecimalDigits="0" ShowSpinButtons="true" MinValue="1" Skin='<%# Owner.Skin %>' /> |
| <%# Owner.Localization.AdvancedHours %> |
| </div> |
| </asp:Panel> |
| <asp:Panel runat="server" ID="RecurrencePatternDailyPanel" CssClass="rsAdvPatternPanel rsAdvDaily" Style="display: none;"> |
| <ul> |
| <li> |
| <asp:RadioButton runat="server" ID="RepeatEveryNthDay" Checked="true" GroupName="DailyRecurrenceDetailRadioGroup" CssClass="rsAdvRadio" /> |
| <telerik:RadNumericTextBox runat="server" CssClass="rsAdvInput" Width="50px" ID="DailyRepeatInterval" Value="1" Type="Number" NumberFormat-DecimalDigits="0" ShowSpinButtons="true" MinValue="1" Skin='<%# Owner.Skin %>' /> |
| <%# Owner.Localization.AdvancedDays %> |
| </li> |
| <li> |
| <asp:RadioButton runat="server" ID="RepeatEveryWeekday" GroupName="DailyRecurrenceDetailRadioGroup" CssClass="rsAdvRadio" /> |
| </li> |
| </ul> |
| </asp:Panel> |
| <asp:Panel runat="server" ID="RecurrencePatternWeeklyPanel" CssClass="rsAdvPatternPanel rsAdvWeekly" Style="display: none;"> |
| <div> |
| <%# Owner.Localization.AdvancedRecurEvery %> |
| <telerik:RadNumericTextBox runat="server" CssClass="rsAdvInput" Width="50px" ID="WeeklyRepeatInterval" Value="1" Type="Number" NumberFormat-DecimalDigits="0" ShowSpinButtons="true" MinValue="1" Skin='<%# Owner.Skin %>' /> |
| <%# Owner.Localization.AdvancedWeeks %> |
| </div> |
| <ul class="rsAdvWeekly_WeekDays"> |
| <li> |
| <asp:CheckBox runat="server" CssClass="rsAdvCheckboxWrapper" ID="WeeklyWeekDaySunday" /></li> |
| <li> |
| <asp:CheckBox runat="server" CssClass="rsAdvCheckboxWrapper" ID="WeeklyWeekDayMonday" /></li> |
| <li> |
| <asp:CheckBox runat="server" CssClass="rsAdvCheckboxWrapper" ID="WeeklyWeekDayTuesday" /></li> |
| <li> |
| <asp:CheckBox runat="server" CssClass="rsAdvCheckboxWrapper" ID="WeeklyWeekDayWednesday" /></li> |
| <li style="clear: left;"> |
| <asp:CheckBox runat="server" CssClass="rsAdvCheckboxWrapper" ID="WeeklyWeekDayThursday" /></li> |
| <li> |
| <asp:CheckBox runat="server" CssClass="rsAdvCheckboxWrapper" ID="WeeklyWeekDayFriday" /></li> |
| <li> |
| <asp:CheckBox runat="server" CssClass="rsAdvCheckboxWrapper" ID="WeeklyWeekDaySaturday" /></li> |
| </ul> |
| </asp:Panel> |
| <asp:Panel runat="server" ID="RecurrencePatternMonthlyPanel" CssClass="rsAdvPatternPanel rsAdvMonthly" Style="display: none;"> |
| <ul> |
| <li> |
| <asp:RadioButton runat="server" ID="RepeatEveryNthMonthOnDate" Checked="true" GroupName="MonthlyRecurrenceRadioGroup" CssClass="rsAdvRadio" /> |
| <telerik:RadNumericTextBox runat="server" CssClass="rsAdvInput" Width="50px" ID="MonthlyRepeatDate" Value="1" Type="Number" NumberFormat-DecimalDigits="0" ShowSpinButtons="true" MinValue="1" MaxValue="31" Skin='<%# Owner.Skin %>' /> |
| <%# Owner.Localization.AdvancedOfEvery %> |
| <telerik:RadNumericTextBox runat="server" CssClass="rsAdvInput" Width="50px" ID="MonthlyRepeatIntervalForDate" Value="1" Type="Number" NumberFormat-DecimalDigits="0" ShowSpinButtons="true" MinValue="1" Skin='<%# Owner.Skin %>' /> |
| <%# Owner.Localization.AdvancedMonths %> |
| </li> |
| <li> |
| <asp:RadioButton runat="server" ID="RepeatEveryNthMonthOnGivenDay" GroupName="MonthlyRecurrenceRadioGroup" CssClass="rsAdvRadio" /> |
| <telerik:RadComboBox runat="server" ID="MonthlyDayOrdinalDropDown" Width="70px" Skin='<%# Owner.Skin %>' CssClass="rsAdvRecurrenceDropDown"> |
| <%--Populated from code-behind--%> |
| </telerik:RadComboBox> |
| <telerik:RadComboBox runat="server" ID="MonthlyDayMaskDropDown" Width="110px" Skin='<%# Owner.Skin %>' CssClass="rsAdvRecurrenceDropDown"> |
| <%--Populated from code-behind--%> |
| </telerik:RadComboBox> |
| <%# Owner.Localization.AdvancedOfEvery %> |
| <telerik:RadNumericTextBox runat="server" CssClass="rsAdvInput" Width="50px" ID="MonthlyRepeatIntervalForGivenDay" Value="1" Type="Number" NumberFormat-DecimalDigits="0" ShowSpinButtons="true" MinValue="1" Skin='<%# Owner.Skin %>' /> |
| <%# Owner.Localization.AdvancedMonths %> |
| </li> |
| </ul> |
| </asp:Panel> |
| <asp:Panel runat="server" ID="RecurrencePatternYearlyPanel" CssClass="rsAdvPatternPanel rsAdvYearly" Style="display: none;"> |
| <ul> |
| <li> |
| <asp:RadioButton runat="server" ID="RepeatEveryYearOnDate" Checked="true" GroupName="YearlyRecurrenceRadioGroup" CssClass="rsAdvRadio" /> |
| <telerik:RadComboBox runat="server" ID="YearlyRepeatMonthForDate" Width="90px" Skin='<%# Owner.Skin %>'> |
| <%--Populated from code-behind--%> |
| </telerik:RadComboBox> |
| <telerik:RadNumericTextBox runat="server" CssClass="rsAdvInput" Width="50px" ID="YearlyRepeatDate" Value="1" Type="Number" NumberFormat-DecimalDigits="0" ShowSpinButtons="true" MinValue="1" MaxValue="31" Skin='<%# Owner.Skin %>' /> |
| </li> |
| <li> |
| <asp:RadioButton runat="server" ID="RepeatEveryYearOnGivenDay" GroupName="YearlyRecurrenceRadioGroup" CssClass="rsAdvRadio" /> |
| <telerik:RadComboBox runat="server" ID="YearlyDayOrdinalDropDown" Width="70px" Skin='<%# Owner.Skin %>' CssClass="rsAdvRecurrenceDropDown"> |
| <%--Populated from code-behind--%> |
| </telerik:RadComboBox> |
| <telerik:RadComboBox runat="server" ID="YearlyDayMaskDropDown" Width="110px" Skin='<%# Owner.Skin %>' CssClass="rsAdvRecurrenceDropDown"> |
| <%--Populated from code-behind--%> |
| </telerik:RadComboBox> |
| <%# Owner.Localization.AdvancedOf %> |
| <telerik:RadComboBox runat="server" ID="YearlyRepeatMonthForGivenDay" Width="90px" Skin='<%# Owner.Skin %>'> |
| <%--Populated from code-behind--%> |
| </telerik:RadComboBox> |
| </li> |
| </ul> |
| </asp:Panel> |
| </asp:Panel> |
| <asp:Panel runat="server" ID="RecurrenceRangePanel" CssClass="rsAdvRecurrenceRangePanel" OnDataBinding="RecurrenceRangePanel_DataBinding"> |
| <ul> |
| <li> |
| <asp:RadioButton runat="server" ID="RepeatIndefinitely" Checked="true" GroupName="RecurrenceRangeRadioGroup" CssClass="rsAdvRadio" /> |
| </li> |
| <li> |
| <asp:RadioButton runat="server" ID="RepeatGivenOccurrences" GroupName="RecurrenceRangeRadioGroup" CssClass="rsAdvRadio" /> |
| <telerik:RadNumericTextBox runat="server" CssClass="rsAdvInput" Width="50px" ID="RangeOccurrences" Type="Number" NumberFormat-DecimalDigits="0" ShowSpinButtons="true" MinValue="1" Skin='<%# Owner.Skin %>' /> |
| <%# Owner.Localization.AdvancedOccurrences %> |
| </li> |
| <li class="rsTimePick"> |
| <asp:RadioButton runat="server" ID="RepeatUntilGivenDate" GroupName="RecurrenceRangeRadioGroup" CssClass="rsAdvRadio" /> |
| <telerik:RadDatePicker runat="server" ID="RangeEndDate" CssClass="rsAdvDatePicker" Width="83px" Skin='<%# Owner.Skin %>' SharedCalendarID="SharedCalendar" Culture='<%# Owner.Culture %>'> |
| <DatePopupButton Visible="False" /> |
| <DateInput ID="DateInput1" runat="server" DateFormat='<%# Owner.AdvancedForm.DateFormat %>' /> |
| </telerik:RadDatePicker> |
| </li> |
| </ul> |
| </asp:Panel> |
| </asp:Panel> |
| <asp:HiddenField runat="server" ID="OriginalRecurrenceRule" /> |
| <telerik:RadCalendar runat="server" ID="SharedCalendar" Skin='<%# Owner.Skin %>' CultureInfo='<%# Owner.Culture %>' ShowRowHeaders="false" RangeMinDate="1900-01-01" /> |
| </asp:Panel> |
| </div> |
| </ContentTemplate> |
| </asp:UpdatePanel> |
| <asp:Panel runat="server" ID="pnlModalPopup" CssClass="modalpopup" Style="display: none; height: 400px; width: 550px;"> |
| <asp:UpdatePanel ID="updtAddTeamMembers" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true"> |
| <ContentTemplate> |
| <div class="ModalHeader" style="text-align: right"> |
| <span style="float: left; padding-top: 3px;">Add Interdisciplinary Team Member</span> |
| <asp:Button ID="btnModal_Cancel" runat="server" CausesValidation="False" Text="Done" OnClientClick="javascript:$find('pnlModalPopupBehavior').hide();" /> |
| </div> |
| <uc2:UserSearch ID="UserSearch1" runat="server" OnUserSelected="AddTeamMember" LoadInUpdatePanel="false" /> |
| </ContentTemplate> |
| </asp:UpdatePanel> |
| </asp:Panel> |
| <asp:Panel runat="server" ID="ButtonsPanel" CssClass="rsAdvancedSubmitArea"> |
| <div class="rsAdvButtonWrapper"> |
| <asp:LinkButton runat="server" ID="UpdateButton" CssClass="rsAdvEditSave"> |
| <span><%# Owner.Localization.Save %></span> |
| </asp:LinkButton> |
| <asp:LinkButton runat="server" ID="CancelButton" CssClass="rsAdvEditCancel" CommandName="Cancel" CausesValidation="false"> |
| <span><%# Owner.Localization.Cancel %></span> |
| </asp:LinkButton> |
| </div> |
| </asp:Panel> |
| </div> |
| </div> |
| // =========================================================================================================== // ================================== Here's the Code for AdvancedForm.ascx.cs =============================== // =========================================================================================================== using System; |
| using System.ComponentModel; |
| using System.Web.UI; |
| using System.Web.UI.WebControls; |
| using Telerik.Web.UI; |
| namespace SchedulerTemplatesCS |
| { |
| /// <summary> |
| /// Specifies the advanced form mode. |
| /// </summary> |
| public enum AdvancedFormMode |
| { |
| Insert, Edit |
| } |
| public partial class AdvancedForm : UserControl |
| { |
| #region Private members |
| private static readonly string[] DayOrdinalValues = { "1", "2", "3", "4", "-1" }; |
| private static readonly string[] DayMaskValues = { |
| ((int) RecurrenceDay.EveryDay).ToString(), |
| ((int) RecurrenceDay.WeekDays).ToString(), |
| ((int) RecurrenceDay.WeekendDays).ToString(), |
| ((int) RecurrenceDay.Sunday).ToString(), |
| ((int) RecurrenceDay.Monday).ToString(), |
| ((int) RecurrenceDay.Tuesday).ToString(), |
| ((int) RecurrenceDay.Wednesday).ToString(), |
| ((int) RecurrenceDay.Thursday).ToString(), |
| ((int) RecurrenceDay.Friday).ToString(), |
| ((int) RecurrenceDay.Saturday).ToString() }; |
| private string[] DayOrdinalDescriptions; |
| private string[] DayMaskDescriptions; |
| private readonly string[] InvariantMonthNames; |
| private bool FormInitialized |
| { |
| get |
| { |
| return (bool)(ViewState["FormInitialized"] ?? false); |
| } |
| set |
| { |
| ViewState["FormInitialized"] = value; |
| } |
| } |
| private AdvancedFormMode mode = AdvancedFormMode.Insert; |
| #endregion |
| #region Protected properties |
| protected RadScheduler Owner |
| { |
| get |
| { |
| return Appointment.Owner; |
| } |
| } |
| protected Appointment Appointment |
| { |
| get |
| { |
| SchedulerFormContainer container = (SchedulerFormContainer)BindingContainer; |
| return container.Appointment; |
| } |
| } |
| protected RecurrenceFrequency Frequency |
| { |
| get |
| { |
| if (RecurrentAppointment != null && RecurrentAppointment.Checked) |
| { |
| if (RepeatFrequencyHourly != null && RepeatFrequencyHourly.Checked) |
| { |
| return RecurrenceFrequency.Hourly; |
| } |
| if (RepeatFrequencyDaily != null && RepeatFrequencyDaily.Checked) |
| { |
| return RecurrenceFrequency.Daily; |
| } |
| if (RepeatFrequencyWeekly != null && RepeatFrequencyWeekly.Checked) |
| { |
| return RecurrenceFrequency.Weekly; |
| } |
| if (RepeatFrequencyMonthly != null && RepeatFrequencyMonthly.Checked) |
| { |
| return RecurrenceFrequency.Monthly; |
| } |
| if (RepeatFrequencyYearly != null && RepeatFrequencyYearly.Checked) |
| { |
| return RecurrenceFrequency.Yearly; |
| } |
| } |
| return RecurrenceFrequency.None; |
| } |
| } |
| protected int Interval |
| { |
| get |
| { |
| switch (Frequency) |
| { |
| case RecurrenceFrequency.Hourly: |
| return int.Parse(HourlyRepeatInterval.Text); |
| case RecurrenceFrequency.Daily: |
| if (RepeatEveryNthDay.Checked) |
| { |
| return int.Parse(DailyRepeatInterval.Text); |
| } |
| break; |
| case RecurrenceFrequency.Weekly: |
| return int.Parse(WeeklyRepeatInterval.Text); |
| case RecurrenceFrequency.Monthly: |
| if (RepeatEveryNthMonthOnDate.Checked) |
| { |
| return int.Parse(MonthlyRepeatIntervalForDate.Text); |
| } |
| return int.Parse(MonthlyRepeatIntervalForGivenDay.Text); |
| } |
| return 0; |
| } |
| } |
| protected RecurrenceDay DaysOfWeekMask |
| { |
| get |
| { |
| switch (Frequency) |
| { |
| case RecurrenceFrequency.Daily: |
| return (RepeatEveryWeekday.Checked) ? RecurrenceDay.WeekDays : RecurrenceDay.EveryDay; |
| case RecurrenceFrequency.Weekly: |
| RecurrenceDay finalMask = RecurrenceDay.None; |
| finalMask |= WeeklyWeekDayMonday.Checked ? RecurrenceDay.Monday : finalMask; |
| finalMask |= WeeklyWeekDayTuesday.Checked ? RecurrenceDay.Tuesday : finalMask; |
| finalMask |= WeeklyWeekDayWednesday.Checked ? RecurrenceDay.Wednesday : finalMask; |
| finalMask |= WeeklyWeekDayThursday.Checked ? RecurrenceDay.Thursday : finalMask; |
| finalMask |= WeeklyWeekDayFriday.Checked ? RecurrenceDay.Friday : finalMask; |
| finalMask |= WeeklyWeekDaySaturday.Checked ? RecurrenceDay.Saturday : finalMask; |
| finalMask |= WeeklyWeekDaySunday.Checked ? RecurrenceDay.Sunday : finalMask; |
| return finalMask; |
| case RecurrenceFrequency.Monthly: |
| if (RepeatEveryNthMonthOnGivenDay.Checked) |
| { |
| return (RecurrenceDay)Enum.Parse(typeof(RecurrenceDay), MonthlyDayMaskDropDown.SelectedValue); |
| } |
| break; |
| case RecurrenceFrequency.Yearly: |
| if (RepeatEveryYearOnGivenDay.Checked) |
| { |
| return (RecurrenceDay)Enum.Parse(typeof(RecurrenceDay), YearlyDayMaskDropDown.SelectedValue); |
| } |
| break; |
| } |
| return RecurrenceDay.None; |
| } |
| } |
| protected int DayOfMonth |
| { |
| get |
| { |
| switch (Frequency) |
| { |
| case RecurrenceFrequency.Monthly: |
| return (RepeatEveryNthMonthOnDate.Checked ? int.Parse(MonthlyRepeatDate.Text) : 0); |
| case RecurrenceFrequency.Yearly: |
| return (RepeatEveryYearOnDate.Checked ? int.Parse(YearlyRepeatDate.Text) : 0); |
| } |
| return 0; |
| } |
| } |
| protected int DayOrdinal |
| { |
| get |
| { |
| switch (Frequency) |
| { |
| case RecurrenceFrequency.Monthly: |
| if (RepeatEveryNthMonthOnGivenDay.Checked) |
| { |
| return int.Parse(MonthlyDayOrdinalDropDown.SelectedValue); |
| } |
| break; |
| case RecurrenceFrequency.Yearly: |
| if (RepeatEveryYearOnGivenDay.Checked) |
| { |
| return int.Parse(YearlyDayOrdinalDropDown.SelectedValue); |
| } |
| break; |
| } |
| return 0; |
| } |
| } |
| protected RecurrenceMonth Month |
| { |
| get |
| { |
| if (Frequency == RecurrenceFrequency.Yearly) |
| { |
| string selectedMonth; |
| if (RepeatEveryYearOnDate.Checked) |
| { |
| selectedMonth = YearlyRepeatMonthForDate.SelectedValue; |
| } |
| else |
| { |
| selectedMonth = YearlyRepeatMonthForGivenDay.SelectedValue; |
| } |
| return (RecurrenceMonth)Enum.Parse(typeof(RecurrenceMonth), selectedMonth); |
| } |
| return RecurrenceMonth.None; |
| } |
| } |
| private RecurrencePattern Pattern |
| { |
| get |
| { |
| if (!RecurrentAppointment.Checked) |
| { |
| return null; |
| } |
| RecurrencePattern submittedPattern = new RecurrencePattern(); |
| submittedPattern.Frequency = Frequency; |
| submittedPattern.Interval = Interval; |
| submittedPattern.DaysOfWeekMask = DaysOfWeekMask; |
| submittedPattern.DayOfMonth = DayOfMonth; |
| submittedPattern.DayOrdinal = DayOrdinal; |
| submittedPattern.Month = Month; |
| if (submittedPattern.Frequency == RecurrenceFrequency.Weekly) |
| { |
| submittedPattern.FirstDayOfWeek = Owner.FirstDayOfWeek; |
| } |
| return submittedPattern; |
| } |
| } |
| private RecurrenceRange Range |
| { |
| get |
| { |
| bool dateSpecified = StartDate.SelectedDate.HasValue && EndDate.SelectedDate.HasValue; |
| bool timeSpecified = StartTime.SelectedDate.HasValue && EndTime.SelectedDate.HasValue; |
| if ((AllDayEvent.Checked && !dateSpecified) || |
| (!AllDayEvent.Checked && !(dateSpecified && timeSpecified))) |
| { |
| return new RecurrenceRange(); |
| } |
| DateTime startDate = StartDate.SelectedDate.Value.Date; |
| DateTime endDate = EndDate.SelectedDate.Value.Date; |
| if (AllDayEvent.Checked) |
| { |
| startDatestartDate = startDate.Date; |
| endDateendDate = endDate.Date.AddDays(1); |
| } |
| else |
| { |
| TimeSpan startTime = StartTime.SelectedDate.Value.TimeOfDay; |
| startDatestartDate = startDate.Add(startTime); |
| TimeSpan endTime = EndTime.SelectedDate.Value.TimeOfDay; |
| endDateendDate = endDate.Add(endTime); |
| } |
| startDate = Owner.DisplayToUtc(startDate); |
| endDate = Owner.DisplayToUtc(endDate); |
| RecurrenceRange range = new RecurrenceRange(); |
| range.Start = startDate; |
| range.EventDuration = endDate - startDate; |
| range.MaxOccurrences = 0; |
| range.RecursUntil = DateTime.MaxValue; |
| if (Owner.RecurrenceSupport) |
| { |
| if (RepeatGivenOccurrences.Checked) |
| { |
| int maxOccurrences; |
| int.TryParse(RangeOccurrences.Text, out maxOccurrences); |
| range.MaxOccurrences = maxOccurrences; |
| } |
| if (RepeatUntilGivenDate.Checked && RangeEndDate.SelectedDate.HasValue) |
| { |
| range.RecursUntil = Owner.DisplayToUtc(RangeEndDate.SelectedDate.Value); |
| if (!AllDayEvent.Checked) |
| { |
| rangerange.RecursUntil = range.RecursUntil.AddDays(1); |
| } |
| } |
| } |
| return range; |
| } |
| } |
| #endregion |
| #region Attributes and resources |
| [Bindable(BindableSupport.Yes, BindingDirection.TwoWay)] |
| public string Attendees |
| { |
| get |
| { |
| return AttendeesText.Text; |
| } |
| set |
| { |
| AttendeesText.Text = value; |
| } |
| } |
| [Bindable(BindableSupport.Yes, BindingDirection.TwoWay)] |
| public string AttendeesID |
| { |
| get |
| { |
| return AttendeesIDText.Text; |
| } |
| set |
| { |
| AttendeesIDText.Text = value; |
| } |
| } |
| [Bindable(BindableSupport.Yes, BindingDirection.TwoWay)] |
| public string Clients |
| { |
| get |
| { |
| return ClientsText.Text; |
| } |
| set |
| { |
| ClientsText.Text = value; |
| } |
| } |
| [Bindable(BindableSupport.Yes, BindingDirection.TwoWay)] |
| public string ClientsID |
| { |
| get |
| { |
| return ClientsIDText.Text; |
| } |
| set |
| { |
| ClientsIDText.Text = value; |
| } |
| } |
| [Bindable(BindableSupport.Yes, BindingDirection.TwoWay)] |
| public string Description |
| { |
| get |
| { |
| return DescriptionText.Text; |
| } |
| set |
| { |
| DescriptionText.Text = value; |
| } |
| } |
| [Bindable(BindableSupport.Yes, BindingDirection.TwoWay)] |
| public object TypeID |
| { |
| get |
| { |
| return ResourceControl1.Value; |
| } |
| set |
| { |
| ResourceControl1.Value = value; |
| } |
| } |
| [Bindable(BindableSupport.Yes, BindingDirection.TwoWay)] |
| public object ClientID |
| { |
| get |
| { |
| return ResourceControl2.Value; |
| } |
| set |
| { |
| ResourceControl2.Value = value; |
| } |
| } |
| [Bindable(BindableSupport.Yes, BindingDirection.TwoWay)] |
| public object PriorityID |
| { |
| get |
| { |
| return ResourceControl3.Value; |
| } |
| set |
| { |
| ResourceControl3.Value = value; |
| } |
| } |
| #endregion |
| #region Public properties |
| public AdvancedFormMode Mode |
| { |
| get |
| { |
| return mode; |
| } |
| set |
| { |
| mode = value; |
| } |
| } |
| [Bindable(BindableSupport.Yes, BindingDirection.TwoWay)] |
| public string Subject |
| { |
| get |
| { |
| return SubjectText.Text; |
| } |
| set |
| { |
| SubjectText.Text = value; |
| } |
| } |
| [Bindable(BindableSupport.Yes, BindingDirection.TwoWay)] |
| public DateTime Start |
| { |
| get |
| { |
| return Range.Start; |
| } |
| set |
| { |
| StartDate.SelectedDate = Owner.UtcToDisplay(value); |
| StartTime.SelectedDate = Owner.UtcToDisplay(value); |
| } |
| } |
| [Bindable(BindableSupport.Yes, BindingDirection.TwoWay)] |
| public DateTime End |
| { |
| get |
| { |
| return Range.Start.Add(Range.EventDuration); |
| } |
| set |
| { |
| EndDate.SelectedDate = Owner.UtcToDisplay(value); |
| EndTime.SelectedDate = Owner.UtcToDisplay(value); |
| } |
| } |
| [Bindable(BindableSupport.Yes, BindingDirection.TwoWay)] |
| public string RecurrenceRuleText |
| { |
| get |
| { |
| if (Owner.RecurrenceSupport) |
| { |
| RecurrenceRule rrule = RecurrenceRule.FromPatternAndRange(Pattern, Range); |
| if (rrule == null) |
| { |
| return string.Empty; |
| } |
| RecurrenceRule originalRule; |
| if (RecurrenceRule.TryParse(OriginalRecurrenceRule.Value, out originalRule)) |
| { |
| rrule.Exceptions = originalRule.Exceptions; |
| } |
| return rrule.ToString(); |
| } |
| return string.Empty; |
| } |
| set |
| { |
| OriginalRecurrenceRule.Value = value; |
| } |
| } |
| #endregion |
| public AdvancedForm() |
| { |
| InvariantMonthNames = new string[12]; |
| Array.Copy(Enum.GetNames(typeof(RecurrenceMonth)), 1, InvariantMonthNames, 0, 12); |
| } |
| protected void Page_Load(object sender, EventArgs e) |
| { |
| //string[] stringArray1 = { |
| // "[Notification Details]"+ fvMessageData.ClientID |
| // }; |
| //imgIconAddAttendee.Attributes["onclick"] = PrintGetURL(stringArray1); |
| //string[] stringArray2 = { |
| // "[Notification Details]"+ fvMessageData.ClientID |
| // }; |
| //imgIconAddClient.Attributes["onclick"] = PrintGetURL(stringArray2); |
| UpdateButton.ValidationGroup = Owner.ValidationGroup; |
| UpdateButton.CommandName = Mode == AdvancedFormMode.Edit ? "Update" : "Insert"; |
| if (!FormInitialized) |
| { |
| InitializeStrings(); |
| PopulateDescriptions(); |
| InitializeMonthlyRecurrenceControls(); |
| InitializeYearlyRecurrenceControls(); |
| PrefillRecurrenceControls(); |
| UpdateResetExceptionsVisibility(); |
| } |
| } |
| protected void AddTeamMember2(object sender, EventArgs e) |
| { |
| AttendeesIDText.Text = "hhh"; |
| updtAdvFormControls.Update(); |
| } |
| protected void AddTeamMember(object sender, CaseCare.BLL.SystemCore.Events.UserSelectedEventArgs e) |
| { |
| //----Put Selected Value In Text Box------------------ |
| //TextBox txt = new TextBox(); |
| string ClientNameArray = AttendeesText.Text; |
| string ClientIdArray = AttendeesText.Attributes["ClientList"]; |
| if (ClientIdArray == null || ClientIdArray.Trim() == "") |
| { |
| ClientIdArray = e.UserId; |
| ClientNameArray = e.UserName; |
| } |
| else |
| { |
| ClientIdArrayClientIdArray = ClientIdArray + "," + e.UserId; |
| ClientNameArrayClientNameArray = ClientNameArray + ", " + e.UserName; |
| } |
| AttendeesText.Text = ClientNameArray; |
| AttendeesIDText.Text = ClientIdArray; |
| // TextBox1.Text = ClientIdArray; |
| RadTextBox1.Text = "hhh"; |
| AttendeesText.Text = "hhh"; |
| AllDayEvent.Checked = true; |
| //RadTextBox1.Visible = false; |
| AttendeesText.Attributes["ClientList"] = ClientIdArray; |
| //----Populate Values---------------------------------------- |
| //foreach (var i in ClientArray.Split(',')) |
| //{ |
| // CaseCare.DataEntities.Client.ClientDataTable ClientDT = CaseCare.BLL.Client.Client.GetClientData(i); |
| // if (ClientDT.Rows.Count > 0) |
| // { |
| // CaseCare.DataEntities.Client.ClientDetailsRow ThisClient = (CaseCare.DataEntities.Client.ClientDetailsRow)ClientDT.Rows[0]; |
| // ThisClient.Client_ID |
| // } |
| //} |
| //AddMemeber |
| // new CaseCare.BLL.FormLibrary.ITP.Members().AddMember("", e.UserId, Convert.ToInt32(varITPID)); |
| // gvTeamMembers.DataBind(); |
| //btnAddTeamMember_ModalPopupExtender.Hide(); |
| //updtAdvFormControls.Update(); |
| updtAddTeamMembers.Update(); |
| } |
| protected override void OnPreRender(EventArgs e) |
| { |
| base.OnPreRender(e); |
| if (!FormInitialized) |
| { |
| if (IsAllDayAppointment(Appointment)) |
| { |
| EndDateEndDate.SelectedDate = EndDate.SelectedDate.Value.AddDays(-1); |
| } |
| FormInitialized = true; |
| } |
| } |
| protected void BasicControlsPanel_DataBinding(object sender, EventArgs e) |
| { |
| AllDayEvent.Checked = IsAllDayAppointment(Appointment); |
| } |
| protected void RecurrencePatternPanel_DataBinding(object sender, EventArgs e) |
| { |
| RecurrenceRule rrule; |
| if (!RecurrenceRule.TryParse(OriginalRecurrenceRule.Value, out rrule)) |
| { |
| RecurrentAppointment.Checked = false; |
| return; |
| } |
| RecurrentAppointment.Checked = true; |
| string interval = rrule.Pattern.Interval.ToString(); |
| int mask = (int)rrule.Pattern.DaysOfWeekMask; |
| switch (rrule.Pattern.Frequency) |
| { |
| case RecurrenceFrequency.Hourly: |
| RepeatFrequencyHourly.Checked = true; |
| HourlyRepeatInterval.Text = interval; |
| break; |
| case RecurrenceFrequency.Daily: |
| RepeatFrequencyDaily.Checked = true; |
| if (rrule.Pattern.DaysOfWeekMask == RecurrenceDay.WeekDays) |
| { |
| RepeatEveryWeekday.Checked = true; |
| RepeatEveryNthDay.Checked = false; |
| } |
| else |
| { |
| RepeatEveryWeekday.Checked = false; |
| RepeatEveryNthDay.Checked = true; |
| DailyRepeatInterval.Text = interval; |
| } |
| break; |
| case RecurrenceFrequency.Weekly: |
| RepeatFrequencyWeekly.Checked = true; |
| WeeklyRepeatInterval.Text = interval; |
| WeeklyWeekDayMonday.Checked = (RecurrenceDay.Monday & rrule.Pattern.DaysOfWeekMask) == RecurrenceDay.Monday; |
| WeeklyWeekDayTuesday.Checked = (RecurrenceDay.Tuesday & rrule.Pattern.DaysOfWeekMask) == RecurrenceDay.Tuesday; |
| WeeklyWeekDayWednesday.Checked = (RecurrenceDay.Wednesday & rrule.Pattern.DaysOfWeekMask) == RecurrenceDay.Wednesday; |
| WeeklyWeekDayThursday.Checked = (RecurrenceDay.Thursday & rrule.Pattern.DaysOfWeekMask) == RecurrenceDay.Thursday; |
| WeeklyWeekDayFriday.Checked = (RecurrenceDay.Friday & rrule.Pattern.DaysOfWeekMask) == RecurrenceDay.Friday; |
| WeeklyWeekDaySaturday.Checked = (RecurrenceDay.Saturday & rrule.Pattern.DaysOfWeekMask) == RecurrenceDay.Saturday; |
| WeeklyWeekDaySunday.Checked = (RecurrenceDay.Sunday & rrule.Pattern.DaysOfWeekMask) == RecurrenceDay.Sunday; |
| break; |
| case RecurrenceFrequency.Monthly: |
| RepeatFrequencyMonthly.Checked = true; |
| if (0 < rrule.Pattern.DayOfMonth) |
| { |
| RepeatEveryNthMonthOnDate.Checked = true; |
| RepeatEveryNthMonthOnGivenDay.Checked = false; |
| MonthlyRepeatDate.Text = rrule.Pattern.DayOfMonth.ToString(); |
| MonthlyRepeatIntervalForDate.Text = interval; |
| } |
| else |
| { |
| RepeatEveryNthMonthOnDate.Checked = false; |
| RepeatEveryNthMonthOnGivenDay.Checked = true; |
| MonthlyDayOrdinalDropDown.SelectedValue = rrule.Pattern.DayOrdinal.ToString(); |
| MonthlyDayMaskDropDown.SelectedIndex = Array.IndexOf(DayMaskValues, (mask).ToString()); |
| MonthlyRepeatIntervalForGivenDay.Text = interval; |
| } |
| break; |
| case RecurrenceFrequency.Yearly: |
| RepeatFrequencyYearly.Checked = true; |
| if (0 < rrule.Pattern.DayOfMonth) |
| { |
| RepeatEveryYearOnDate.Checked = true; |
| RepeatEveryYearOnGivenDay.Checked = false; |
| YearlyRepeatDate.Text = rrule.Pattern.DayOfMonth.ToString(); |
| YearlyRepeatMonthForDate.SelectedIndex = ((int)rrule.Pattern.Month) - 1; |
| } |
| else |
| { |
| RepeatEveryYearOnDate.Checked = false; |
| RepeatEveryYearOnGivenDay.Checked = true; |
| YearlyDayOrdinalDropDown.SelectedValue = rrule.Pattern.DayOrdinal.ToString(); |
| YearlyDayMaskDropDown.SelectedIndex = Array.IndexOf(DayMaskValues, (mask).ToString()); |
| YearlyRepeatMonthForGivenDay.SelectedIndex = ((int)rrule.Pattern.Month) - 1; |
| } |
| break; |
| } |
| } |
| protected void RecurrenceRangePanel_DataBinding(object sender, EventArgs e) |
| { |
| RecurrenceRule rrule; |
| if (!RecurrenceRule.TryParse(OriginalRecurrenceRule.Value, out rrule)) |
| { |
| return; |
| } |
| bool occurrencesLimit = (rrule.Range.MaxOccurrences != int.MaxValue); |
| bool timeLimit = (rrule.Range.RecursUntil != DateTime.MaxValue); |
| if (!occurrencesLimit && !timeLimit) |
| { |
| RepeatIndefinitely.Checked = true; |
| RepeatGivenOccurrences.Checked = false; |
| RepeatUntilGivenDate.Checked = false; |
| } |
| else |
| if (occurrencesLimit) |
| { |
| RepeatIndefinitely.Checked = false; |
| RepeatGivenOccurrences.Checked = true; |
| RepeatUntilGivenDate.Checked = false; |
| RangeOccurrences.Text = rrule.Range.MaxOccurrences.ToString(); |
| } |
| else |
| { |
| RepeatIndefinitely.Checked = false; |
| RepeatGivenOccurrences.Checked = false; |
| RepeatUntilGivenDate.Checked = true; |
| RangeEndDate.SelectedDate = Owner.UtcToDisplay(rrule.Range.RecursUntil).AddDays(-1); |
| } |
| } |
| protected void DurationValidator_OnServerValidate(object source, ServerValidateEventArgs args) |
| { |
| args.IsValid = Range.EventDuration > TimeSpan.Zero; |
| } |
| protected void ResetExceptions_OnClick(object sender, EventArgs e) |
| { |
| Owner.RemoveRecurrenceExceptions(Appointment); |
| OriginalRecurrenceRule.Value = Appointment.RecurrenceRule; |
| ResetExceptions.Text = Owner.Localization.AdvancedDone; |
| } |
| #region Private methods |
| private void InitializeStrings() |
| { |
| SubjectValidator.ErrorMessage = Owner.Localization.AdvancedSubjectRequired; |
| SubjectValidator.ValidationGroup = Owner.ValidationGroup; |
| AllDayEvent.Text = Owner.Localization.AdvancedAllDayEvent; |
| RecurrentAppointment.Text = Owner.Localization.AdvancedRecurrence; |
| StartDateValidator.ErrorMessage = Owner.Localization.AdvancedStartDateRequired; |
| StartDateValidator.ValidationGroup = Owner.ValidationGroup; |
| StartTimeValidator.ErrorMessage = Owner.Localization.AdvancedStartTimeRequired; |
| StartTimeValidator.ValidationGroup = Owner.ValidationGroup; |
| EndDateValidator.ErrorMessage = Owner.Localization.AdvancedEndDateRequired; |
| EndDateValidator.ValidationGroup = Owner.ValidationGroup; |
| EndTimeValidator.ErrorMessage = Owner.Localization.AdvancedEndTimeRequired; |
| EndTimeValidator.ValidationGroup = Owner.ValidationGroup; |
| DurationValidator.ErrorMessage = Owner.Localization.AdvancedStartTimeBeforeEndTime; |
| DurationValidator.ValidationGroup = Owner.ValidationGroup; |
| ResetExceptions.Text = Owner.Localization.AdvancedReset; |
| RepeatFrequencyHourly.Text = Owner.Localization.AdvancedHourly; |
| RepeatFrequencyDaily.Text = Owner.Localization.AdvancedDaily; |
| RepeatFrequencyWeekly.Text = Owner.Localization.AdvancedWeekly; |
| RepeatFrequencyMonthly.Text = Owner.Localization.AdvancedMonthly; |
| RepeatFrequencyYearly.Text = Owner.Localization.AdvancedYearly; |
| RepeatEveryNthDay.Text = Owner.Localization.AdvancedEvery; |
| RepeatEveryWeekday.Text = Owner.Localization.AdvancedEveryWeekday; |
| RepeatEveryNthMonthOnDate.Text = Owner.Localization.AdvancedDay; |
| RepeatEveryNthMonthOnGivenDay.Text = Owner.Localization.AdvancedThe; |
| RepeatEveryYearOnDate.Text = Owner.Localization.AdvancedEvery; |
| RepeatEveryYearOnGivenDay.Text = Owner.Localization.AdvancedThe; |
| RepeatIndefinitely.Text = Owner.Localization.AdvancedNoEndDate; |
| RepeatGivenOccurrences.Text = Owner.Localization.AdvancedEndAfter; |
| RepeatUntilGivenDate.Text = Owner.Localization.AdvancedEndByThisDate; |
| SharedCalendar.FastNavigationSettings.OkButtonCaption = Owner.Localization.AdvancedCalendarOK; |
| SharedCalendar.FastNavigationSettings.CancelButtonCaption = Owner.Localization.AdvancedCalendarCancel; |
| SharedCalendar.FastNavigationSettings.TodayButtonCaption = Owner.Localization.AdvancedCalendarToday; |
| WeeklyWeekDayMonday.Text = Owner.Culture.DateTimeFormat.DayNames[1]; |
| WeeklyWeekDayTuesday.Text = Owner.Culture.DateTimeFormat.DayNames[2]; |
| WeeklyWeekDayWednesday.Text = Owner.Culture.DateTimeFormat.DayNames[3]; |
| WeeklyWeekDayThursday.Text = Owner.Culture.DateTimeFormat.DayNames[4]; |
| WeeklyWeekDayFriday.Text = Owner.Culture.DateTimeFormat.DayNames[5]; |
| WeeklyWeekDaySaturday.Text = Owner.Culture.DateTimeFormat.DayNames[6]; |
| WeeklyWeekDaySunday.Text = Owner.Culture.DateTimeFormat.DayNames[0]; |
| } |
| private void PopulateDescriptions() |
| { |
| DayOrdinalDescriptions = new string[5]; |
| DayOrdinalDescriptions[0] = Owner.Localization.AdvancedFirst; |
| DayOrdinalDescriptions[1] = Owner.Localization.AdvancedSecond; |
| DayOrdinalDescriptions[2] = Owner.Localization.AdvancedThird; |
| DayOrdinalDescriptions[3] = Owner.Localization.AdvancedFourth; |
| DayOrdinalDescriptions[4] = Owner.Localization.AdvancedLast; |
| DayMaskDescriptions = new string[10]; |
| DayMaskDescriptions[0] = Owner.Localization.AdvancedMaskDay; |
| DayMaskDescriptions[1] = Owner.Localization.AdvancedMaskWeekday; |
| DayMaskDescriptions[2] = Owner.Localization.AdvancedMaskWeekendDay; |
| Array.Copy(Owner.Culture.DateTimeFormat.DayNames, 0, DayMaskDescriptions, 3, 7); |
| } |
| private void InitializeMonthlyRecurrenceControls() |
| { |
| MonthlyDayOrdinalDropDown.Items.AddRange(CreateComboBoxItemArray(DayOrdinalDescriptions, DayOrdinalValues)); |
| MonthlyDayMaskDropDown.Items.AddRange(CreateComboBoxItemArray(DayMaskDescriptions, DayMaskValues)); |
| } |
| private void InitializeYearlyRecurrenceControls() |
| { |
| string[] monthNames = new string[12]; |
| Array.Copy(Owner.Culture.DateTimeFormat.MonthNames, monthNames, 12); |
| YearlyRepeatMonthForDate.Items.AddRange(CreateComboBoxItemArray(monthNames, InvariantMonthNames)); |
| YearlyDayOrdinalDropDown.Items.AddRange(CreateComboBoxItemArray(DayOrdinalDescriptions, DayOrdinalValues)); |
| YearlyDayMaskDropDown.Items.AddRange(CreateComboBoxItemArray(DayMaskDescriptions, DayMaskValues)); |
| YearlyRepeatMonthForGivenDay.Items.AddRange(CreateComboBoxItemArray(monthNames, InvariantMonthNames)); |
| } |
| private void PrefillRecurrenceControls() |
| { |
| DateTime start = Appointment.Start; |
| switch (start.DayOfWeek) |
| { |
| case DayOfWeek.Sunday: |
| WeeklyWeekDaySunday.Checked = true; |
| break; |
| case DayOfWeek.Monday: |
| WeeklyWeekDayMonday.Checked = true; |
| break; |
| case DayOfWeek.Tuesday: |
| WeeklyWeekDayTuesday.Checked = true; |
| break; |
| case DayOfWeek.Wednesday: |
| WeeklyWeekDayWednesday.Checked = true; |
| break; |
| case DayOfWeek.Thursday: |
| WeeklyWeekDayThursday.Checked = true; |
| break; |
| case DayOfWeek.Friday: |
| WeeklyWeekDayFriday.Checked = true; |
| break; |
| case DayOfWeek.Saturday: |
| WeeklyWeekDaySaturday.Checked = true; |
| break; |
| default: |
| throw new ArgumentOutOfRangeException(); |
| } |
| MonthlyRepeatDate.Text = start.Day.ToString(); |
| YearlyRepeatMonthForDate.SelectedValue = InvariantMonthNames[start.Month - 1]; |
| YearlyRepeatMonthForGivenDay.SelectedValue = YearlyRepeatMonthForDate.SelectedValue; |
| YearlyRepeatDate.Text = start.Day.ToString(); |
| } |
| private void UpdateResetExceptionsVisibility() |
| { |
| ResetExceptions.Visible = false; |
| RecurrenceRule rrule; |
| if (RecurrenceRule.TryParse(Appointment.RecurrenceRule, out rrule)) |
| { |
| ResetExceptions.Visible = rrule.Exceptions.Count > 0; |
| } |
| } |
| private bool IsAllDayAppointment(Appointment appointment) |
| { |
| DateTime displayStart = Owner.UtcToDisplay(appointment.Start); |
| DateTime displayEnd = Owner.UtcToDisplay(appointment.End); |
| return displayStart.CompareTo(displayStart.Date) == 0 && displayEnd.CompareTo(displayEnd.Date) == 0; |
| } |
| private static RadComboBoxItem[] CreateComboBoxItemArray(string[] descriptions) |
| { |
| RadComboBoxItem[] listItems = new RadComboBoxItem[descriptions.Length]; |
| for (int i = 0; i < descriptions.Length; i++) |
| { |
| listItems[i] = new RadComboBoxItem(descriptions[i]); |
| } |
| return listItems; |
| } |
| private static RadComboBoxItem[] CreateComboBoxItemArray(string[] descriptions, string[] values) |
| { |
| if (descriptions.Length != values.Length) |
| { |
| throw new InvalidOperationException("There must be equal number of values and descriptions."); |
| } |
| RadComboBoxItem[] listItems = CreateComboBoxItemArray(descriptions); |
| for (int i = 0; i < values.Length; i++) |
| { |
| listItems[i].Value = values[i]; |
| } |
| return listItems; |
| } |
| #endregion |
| } |
| } |
| <%-- =========================================================================================================== --> <%-- ================================== Here's the Markup for UserSearch.ascx ================================== --> <%-- =========================================================================================================== --> <%@ Control Language="C#" AutoEventWireup="true" CodeFile="UserSearch.ascx.cs" Inherits="Cntrls_UserSearch" %> |
| <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
| <asp:UpdatePanel ID="UpdatePanel1" runat="server"> |
| <ContentTemplate> |
| <asp:Panel ID="pnlUserSearch" runat="server"> |
| <asp:Panel ID="pnlSearch" runat="server" Style="white-space: nowrap; float: right; text-align: right; margin-bottom: 5px;" DefaultButton="btnSearch"> |
| <asp:TextBox ID="txtSearchUser" runat="server"></asp:TextBox> |
| <ajx:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender2" runat="server" Enabled="True" TargetControlID="txtSearchUser" WatermarkText="type to search..." WatermarkCssClass="watermarked Textbox" /> |
| <asp:Button ID="btnSearch" runat="server" ToolTip="Submit Search" Text="GO!" OnClick="btnSearch_Click" UseSubmitBehavior="true" CausesValidation="false" /> |
| </asp:Panel> |
| <asp:Label ID="lblUserTitle" runat="server" Text="Search name or type of user..." CssClass="fainttext" Style="float: left;" /> |
| <br /> |
| |
| <asp:GridView ID="gvUserSearch" runat="server" OnSelectedIndexChanged="DoUserSelect" AutoGenerateColumns="False" DataKeyNames="User_ID,UserType_ID" DataSourceID="odsUsers" OnRowDataBound="RowDataBound"> |
| <Columns> |
| <asp:CommandField ShowSelectButton="True" ItemStyle-Width="50px"> |
| <ItemStyle Width="50px" /> |
| </asp:CommandField> |
| <asp:BoundField DataField="FirstName" HeaderText="First Name" SortExpression="FirstName" /> |
| <asp:BoundField DataField="LastName" HeaderText="Last Name" SortExpression="LastName" /> |
| <asp:BoundField DataField="LoginID" HeaderText="LoginID" SortExpression="LoginID" /> |
| <asp:BoundField DataField="UserType" HeaderText="User Type" SortExpression="UserType" /> |
| </Columns> |
| <EmptyDataTemplate> |
| <br /> |
| <br /> |
| <span class="Error" style="text-align: center;"> |
| <p> |
| There are no Users available with the specified search criteria.</p> |
| <br /> |
| <asp:Button ID="btnResetSearch" runat="server" Text="Reset" OnClick="ResetSearch" Style="text-align: center;" /> |
| </span> |
| <br /> |
| <br /> |
| </EmptyDataTemplate> |
| </asp:GridView> |
| <asp:ObjectDataSource ID="odsUsers" runat="server" SelectMethod="GetUsers" TypeName="CaseCare.BLL.User.User"> |
| <SelectParameters> |
| <asp:Parameter DefaultValue="false" Name="IncludeInactive" Type="Boolean" /> |
| </SelectParameters> |
| </asp:ObjectDataSource> |
| <asp:ObjectDataSource ID="odsUsersearch" runat="server" SelectMethod="UserSearch" TypeName="CaseCare.BLL.User.User"> |
| <SelectParameters> |
| <asp:Parameter Name="SearchText" Type="String" /> |
| <asp:Parameter DefaultValue="true" Name="ShowOnlyActive" Type="Boolean" /> |
| </SelectParameters> |
| </asp:ObjectDataSource> |
| </asp:Panel> |
| </ContentTemplate> |
| </asp:UpdatePanel> |
| // =========================================================================================================== // ================================== Here's the Code for UserSearch.ascx.cs ================================= // =========================================================================================================== using System; |
| using System.Collections; |
| using System.Configuration; |
| using System.Data; |
| using System.Linq; |
| using System.Web; |
| using System.Web.Security; |
| using System.Web.UI; |
| using System.Web.UI.HtmlControls; |
| using System.Web.UI.WebControls; |
| using System.Web.UI.WebControls.WebParts; |
| using System.Xml.Linq; |
| public partial class Cntrls_UserSearch : System.Web.UI.UserControl |
| { |
| private string _HideStaffID; |
| public string HideStaffID |
| { |
| set |
| { |
| _HideStaffID = value; |
| } |
| } |
| private bool _LoadInUpdatePanel = true; |
| public bool LoadInUpdatePanel |
| { |
| get { return _LoadInUpdatePanel; } |
| set { _LoadInUpdatePanel = value; } |
| } |
| protected void RowDataBound(object sender, GridViewRowEventArgs args) |
| { |
| if (args.Row.RowType == DataControlRowType.DataRow) |
| { |
| if (gvUserSearch.DataKeys[args.Row.RowIndex].Value.ToString() == _HideStaffID) |
| { |
| args.Row.Visible = false; |
| } |
| } |
| CaseCare.BLL.Web.Extensions.GridviewExt.RowDataBound(sender, args); |
| } |
| protected void btnSearch_Click(object sender, EventArgs e) |
| { |
| odsUsersearch.SelectParameters[0].DefaultValue = txtSearchUser.Text; |
| odsUsersearch.DataBind(); |
| gvUserSearch.DataSourceID = odsUsersearch.ID; |
| } |
| protected void ResetSearch(object sender, EventArgs e) |
| { |
| gvUserSearch.DataSourceID = odsUsers.ID; |
| } |
| //Event Handlers and Delegates |
| public delegate void ClientSelectedEventHandler(object sender, CaseCare.BLL.SystemCore.Events.UserSelectedEventArgs e); |
| public event ClientSelectedEventHandler UserSelected; |
| protected void DoUserSelect(object sender, EventArgs e) |
| { |
| if (UserSelected != null) |
| { |
| //Setup Args |
| string UserID = gvUserSearch.DataKeys[gvUserSearch.SelectedIndex].Value.ToString(); |
| string UserName = gvUserSearch.Rows[gvUserSearch.SelectedIndex].Cells[1].Text + " " + gvUserSearch.Rows[gvUserSearch.SelectedIndex].Cells[2].Text; |
| string UserType = gvUserSearch.Rows[gvUserSearch.SelectedIndex].Cells[3].Text; |
| Int32 UserTypeId = 0; |
| string UserTypeIDSearch = gvUserSearch.DataKeys[gvUserSearch.SelectedIndex].Values["UserType_ID"].ToString(); |
| if (UserTypeIDSearch.Length > 0) |
| { |
| UserTypeId = Convert.ToInt32(UserTypeIDSearch); |
| } |
| //Create new set of eventargs |
| CaseCare.BLL.SystemCore.Events.UserSelectedEventArgs UserArgs = new CaseCare.BLL.SystemCore.Events.UserSelectedEventArgs(UserName, UserID, UserType, UserTypeId); |
| //Send the values off to the caller |
| UserSelected(sender, UserArgs); |
| } |
| } |
| //protected void Page_Load(object sender, EventArgs e) |
| //{ |
| // if (LoadInUpdatePanel) |
| // { |
| // //Create New UPdatePanel |
| // UpdatePanel updt = new UpdatePanel(); |
| // //add existing controls to it |
| // updt.ContentTemplateContainer.Controls.Add(pnlUserSearch); |
| // //Remove so we dont have duplicates of the body |
| // this.Controls.Remove(pnlUserSearch); |
| // //Add the new update panel w/ imported body to the usercontrol; |
| // this.Controls.Add(updt); |
| // } |
| //} |
| } |
As you can now see I'm trying to use my own UserSearch popup control to post back data
from the DoUserSelect function in the popup (UserSearch.ascx.cs) to the AddTeamMember
function inside AdvancedForm.ascx.cs code. Since this did not work I tried to simplify
it by just putting a btnResetSearch button on the page to call AddTeamMember2 on the
OnClick event. This didn't work either.
AddTeamMember & AddTeamMember2 functions do not work inside AdvancedForm.ascx when
using a UpdatePanel inside it.
Kip
|
Check this out...
|
| ===================================RadScheduler Code================================================= |
| <telerik:RadScheduler runat="server" ID="RadScheduler1" Height="450px" Width="750px" SelectedView="WeekView" SelectedDate="2007-08-02" |
| ProviderName="ReadOnlySchedulerData" TimeZoneOffset="03:00:00" |
| OnAppointmentCreated="RadScheduler1_AppointmentCreated" |
| Skin="WebBlue"> |
| <Localization AdvancedAllDayEvent="All Day Event"></Localization> |
| <AdvancedForm Modal="true" /> |
| <AdvancedEditTemplate> |
| <scheduler:AdvancedForm runat="server" ID="AdvancedEditForm1" Mode="Edit" /> |
| </AdvancedEditTemplate> |
| <AdvancedInsertTemplate> |
| <scheduler:AdvancedForm runat="server" ID="AdvancedInsertForm1" Mode="Insert" /> |
| </AdvancedInsertTemplate> |
| <AppointmentTemplate> |
| <div id="subject" style="font-size:10px; vertical-align:bottom; padding-bottom:1px; "> |
| <asp:Label runat="server" ID="RecurrenceIcon" /> |
| <%# Eval("Subject") %> |
| </div> |
| <asp:Label runat="server" ID="Type" Font-Size="10px" /> |
| <br /> |
| <asp:Label runat="server" ID="Priority" Font-Size="10px" /> |
| <br /> |
| <asp:Label runat="server" ID="Clients" Font-Size="10px" /> |
| </AppointmentTemplate> |
| <TimelineView UserSelectable="false" /> |
| </telerik:RadScheduler> |
| ==================================="AdvancedEditForm1" Code Behind================================================= |
| using System; |
| using System.ComponentModel; |
| using System.Web.UI; |
| using System.Web.UI.WebControls; |
| using Telerik.Web.UI; |
| namespace SchedulerTemplatesCS |
| { |
| public partial class AdvancedForm : UserControl |
| { |
| protected void AddTeamMember2(object sender, EventArgs e) |
| { |
| TextBox1.Text = "hhh"; |
| updtAdvFormControls.Update(); |
| } |
| } |
| } |
| ==================================="AdvancedEditForm1" Mark Up Text================================================= |
| <%@ Control Language="C#" AutoEventWireup="true" CodeFile="AdvancedForm.ascx.cs" Inherits="SchedulerTemplatesCS.AdvancedForm" %> |
| <div class="rsAdvancedEdit" > |
| <asp:UpdatePanel ID="updtAdvFormControls" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false"> |
| <ContentTemplate> |
| <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> |
| <asp:Button ID="btnResetSearch" runat="server" Text="Reset" OnClick="AddTeamMember2" /> |
| </ContentTemplate> |
| </asp:UpdatePanel> |
| </div> |
Do you have AjaxManager in your RadScheduler page? If yes, you need to disable it in order to use the update panel in the advancedform user control. I tried your code with the Q2 2009 demo from this kb article and it worked fine when I disabled RadAjaxManager in the aspx page of RadScheduler.
Regards,
Peter
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.
I did notice the RadAjaxManager was causing more bad side affects then what it was trying to accomplish. It was making the schedule redraw and flash alot.
Kip
I am sending you our test project for reference. If you can modify it so that it shows the problem, please feel free to send it back to us for further testing.
Kind regards,
Peter
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.
| DON'T EVER, EVER, EVER, EVER........ set the RadScheduler1.GroupBy to empty string in the PageLoad event of the RadScheduler code behind page or you will suffer the consequences for life. This statement causes your example and my program to cancel all UpdatePanels. Get this... RadScheduler1.GroupBy was already set to empty string when I set it to empty string and caused this problem. protected void Page_Load(object sender, EventArgs e) |
| { |
| RadScheduler1.GroupBy = ""; |
| } |
| Calling ChangeGroupBy in the OnSelectedIndexChanged event instead of using the Page_Load event to set it seems to let the UpdatePanels work with the GroupBy again. ////////////////////////////////////////////////////////////////////////////////////////// //////////////////Bad Code//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////// protected void Page_Load(object sender, EventArgs e)
////////////////////////////////////////////////////////////////////////////////////////// ////////////////////Good Code///////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////// protected void ChangeGroupBy(object sender, EventArgs e) |
| { |
| RadScheduler1.GroupBy = ((RadComboBox)sender).SelectedValue; |
| } |
| <telerik:RadComboBox ID="RadComboBox2" runat="server" Skin="WebBlue" AutoPostBack="True" OnSelectedIndexChanged="ChangeGroupBy"> |
| <Items> |
| <telerik:RadComboBoxItem runat="server" Selected="True" Text="None" /> |
| <telerik:RadComboBoxItem runat="server" Text="Type" Value="Type" /> |
| <telerik:RadComboBoxItem runat="server" Text="Priority" Value="Priority" /> |
| <telerik:RadComboBoxItem runat="server" Text="Client" Value="Client" /> |
| </Items> |
| </telerik:RadComboBox> |
Thanks for sharing yoru findings. Is the problem all sorted out now?
Greetings,
Peter
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.
away then comes back (flashes) before the AdvancedPanel comes up. I'm guessing it's
trying to post back. The same thing happens after the AdvancedPanel up and you hit the
"Cancel" button. I'm trying to prevent this from happening in my code.
I think it has to do with the EnableAJAX="fase" in the RadAjaxManager.
Is that right? I set it to true and it still flashes.
I saw this article that may be related:
http://www.telerik.com/community/forums/aspnet-ajax/scheduler/radscheduler-doing-a-postback.aspx
Thanks,
Kip
Can you send us a link to the online demo on which you have found this problem to occur?
Regards,
Peter
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.
What I actually meant was if you were able to observe the problem in any of the online example here.
Peter
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.
If you copy the SubjectText (RadTextBox) in the AdvancedFormEdit and then surround it with a UpdatePanel, the copied line surrounded by the UpdatePanel doesn't show the the content of the Eval("Subject") in the RadTextBox in the Page_Load. If you take out the TextMode="MultiLine" in the RadTextBox surrounded by an UpdatePanel, it then shows the content of the Eval("Subject") in the Page_Load. "Bug City"...
Also, check this cool bug out too...
Add the following line right under the SubjectText (RadTextBox) then run the page and
hover the mouse over the "xxxx" and watch the Javascript error blow:
<telerik:RadTextBox ID="RadTextBox1" runat="server" Label="Attendees: " Text='xxxx' Enabled="false" />
| =========Standard RadTextBox Line Found In AdvancedForm (Contents Shows)================ |
| <telerik:RadTextBox runat="server" ID="SubjectText" TextMode="MultiLine" Columns="50" Rows="1" Width="100%" Label='<%# Owner.Localization.AdvancedSubject + ":" %>' Text='<%# Eval("Subject") %>' /> |
| =========Same Line Surrounded With A Update Panel(Contents Doesn't Show)====================== |
| <asp:UpdatePanel ID="UpdatePanel1" runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional"> |
| <ContentTemplate> |
| <telerik:RadTextBox runat="server" ID="RadTextBox1" TextMode="MultiLine" Columns="50" Rows="1" Width="100%" Label='<%# Owner.Localization.AdvancedSubject + ":" %>' Text='<%# Eval("Subject") %>' /> |
| </ContentTemplate> |
| </asp:UpdatePanel> |
Thank you for your bug reports. These issue appear only under specific circumstances, but we will try to prevent them anyway.
Kind regards,
Peter
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.