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

Radscheduler Customize Advance Form Ajax Not Working

3 Answers 108 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Danish
Top achievements
Rank 1
Danish asked on 21 Sep 2013, 11:19 AM
Hi,

I am facing a problem.I want to perform some implementation in Advance Form(which i made customized) through ajax.But it is not working.Simple thing .On one  asp:LinkButton click event i want to update one dropdown list.

Where i add 

  <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" EnableScriptCombine="false">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RCLocation">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RTVDoctors" />
                    <telerik:AjaxUpdatedControl ControlID="RadScheduler1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RTVDoctors">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadScheduler1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadCalendar1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadScheduler1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="btnSavePatient">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RCPatient" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />

 <telerik:RadScheduler runat="server" ID="RadScheduler1" Width="100%" Height="100%"
   OnDataBound="RadScheduler1_DataBound"
   OnAppointmentDataBound="RadScheduler1_AppointmentDataBound"
   OnClientFormCreated="schedulerFormCreated"
   CustomAttributeNames="AppointmentColor,HCUnitId,EmpId,pt_regid,ExRoomId,AppStatusId,CanReason,DeptId,AppId,AppDate"
   EnableDescriptionField="true"
                AppointmentStyleMode="Default"
                Localization-AdvancedClose="Close"
                StartInsertingInAdvancedForm="true"
                OnClientTimeSlotClick="OnClientAppointmentSlot"
                ShowHoursColumn="true"
                MinutesPerRow="15"
                TimeLabelRowSpan="1"
                RowHeight="25px"
                NumberOfHoveredRows="1"
                FirstDayOfWeek="Saturday"
                LastDayOfWeek="Friday"
                OnFormCreated="RadScheduler1_FormCreated"
                Skin="Sitefinity"
                OnAppointmentCreated="RadScheduler1_AppointmentCreated"
                ResourcePopulationMode="ServerSide"
                OnAppointmentDelete="RadScheduler1_AppointmentDelete"
                >
   
                <AdvancedForm Modal="true" />

                <WeekView HeaderDateFormat="dd-MM" />
                
                <MonthView HeaderDateFormat="dd-MM" />

                <DayView HeaderDateFormat="dd-MM" ShowHoursColumn="true" />
   
                <AppointmentTemplate>
                    <table onmouseover="DisplayAppointmentInfo('<%# Eval("Description") %>');" onmouseout="HideAppointmentInfo();" width="30%" border="0" style="border-style:none;" >
                        <tr>
                            <td style="border-style:none;">                                
                                <%# Eval("Subject") %>
                            </td>
                        </tr>
                    </table>
   </AppointmentTemplate>
   
                <AdvancedEditTemplate>
   <scheduler:AdvancedForm runat="server" ID="AdvancedEditForm1" Mode="Edit" 
   LocationID='<%# Bind("HCUnitId") %>'
                        DoctorID='<%# Bind("EmpId") %>'
                        PatientID ='<%# Bind("pt_regid") %>'
                        RoomID ='<%# Bind("ExRoomId") %>'
                        DepartmentID ='<%# RTVDoctors.SelectedNode.ParentNode.Value %>'
                        AppointmentID='<%# Bind("AppId") %>'
                        AppointmentColor='<%# Bind("AppointmentColor") %>'
                        StatusID ='<%# Bind("AppStatusId") %>'
                        Description ='<%# Bind("CanReason") %>'
                        SelectedDate='<%# Bind("Start") %>'
                        Start='<%# Bind("Start") %>'
   End='<%# Bind("End") %>'
    />
   </AdvancedEditTemplate>
   
                <AdvancedInsertTemplate>
   <scheduler:AdvancedForm runat="server" ID="AdvancedInsertForm1" Mode="Insert" 
                        LocationID='<%# RCLocation.SelectedValue %>'
                        DoctorID='<%# RTVDoctors.SelectedValue %>'
                        DepartmentID='<%# RTVDoctors.SelectedNode.ParentNode.Value %>'
                        SelectedDate='<%# RadCalendar1.SelectedDate %>'
                        AppointmentColor='<%# Bind("AppointmentColor") %>'
   Start='<%# Bind("Start") %>'
   End='<%# Bind("End") %>' />
   </AdvancedInsertTemplate>

                <TimelineView UserSelectable="false" />
       <TimeSlotContextMenuSettings EnableDefault="true" />
       <AppointmentContextMenuSettings EnableDefault="true" />        
   </telerik:RadScheduler>

and my advance form 

 <div id="dvtabs">
            <telerik:RadTabStrip runat="server" ID="RTStripTop" Orientation="HorizontalTop" SelectedIndex="0" MultiPageID="RMPages" CssClass="tabstrip" Skin="Office2010Silver" >
                <Tabs>
                    <telerik:RadTab Text="Appointment">
                    </telerik:RadTab>
                </Tabs>
            </telerik:RadTabStrip>
        </div>
        <telerik:RadMultiPage runat="server" ID="RMPages" SelectedIndex="0" CssClass="multiPage" >
            <telerik:RadPageView runat="server" ID="RPVAppointment" >
                <div class="rsAdvOptionsScroll" style="position: relative; height:100px; background-color:#FFFFFF;" id="dvInsideWindow">
                    <asp:Panel runat="server" ID="AdvancedEditOptionsPanel" CssClass="rsAdvOptions" >
                        <asp:Panel runat="server" ID="BasicControlsPanel" CssClass="rsAdvBasicControls" 
                            OnDataBinding="BasicControlsPanel_DataBinding" >
                              <div>
                                    <table cellpadding="10" cellspacing="10"  width="100%">
                                        <tr>
                                            <td width="10%"></td>
                                            <td width="20%"></td>
                                            <td width="10%"></td>
                                            <td width="60%"></td>
                                        </tr>
                                        <tr>
                                            <td><b>Type</b></td>
                                            <td>New Patient  <input id="chkPatient" type="checkbox" onclick="javascript: OpenRegistrationPanel(this);"/></td>
                                            <td></td>
                                            <td></td>
                                        </tr>
                                    </table>
                              </div>
                            <div id="dvPatient" class="dvPatient" style="height:0%;" >
                                <table cellpadding="10" cellspacing="10" width="100%" style="background-color:#bbe094">
                                    <tr>
                                        <td width="10%"></td>
                                        <td width="14%"></td>
                                        <td width="13%"></td>
                                        <td width="23%"></td>
                                        <td width="20%"></td>
                                        <td width="10%"></td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <telerik:RadComboBox ID="RCTitle" runat="server"  MarkFirstMatch="true" Width="100px" Filter="StartsWith" EmptyMessage="Title">
                                            </telerik:RadComboBox>
                                        </td>
                                        <td>
                                            <telerik:RadTextBox ID="RTPatfname" runat="server" EmptyMessage="First Name">
                                                <ClientEvents OnBlur="OnBlur" />
                                            </telerik:RadTextBox>
                                        </td>
                                        <td>
                                            <telerik:RadTextBox ID="RTPatlname" runat="server" EmptyMessage="Last Name">
                                                <ClientEvents OnBlur="OnBlur" />
                                            </telerik:RadTextBox>
                                        </td>
                                        <td>
                                            <telerik:RadDatePicker ID="RDDOB" runat="server" MinDate="01/01/1900" DateInput-ReadOnly="true" EmptyMessage="Date of Birth">
                                                <Calendar Skin='<%# Owner.Skin %>' UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False" 
                                                                ViewSelectorText="x" ShowOtherMonthsDays="False" ShowRowHeaders="False"> 
                                                    <SpecialDays> 
                                                        <telerik:RadCalendarDay Repeatable="Today">  
                                                            <ItemStyle CssClass="rcToday" /> 
                                                        </telerik:RadCalendarDay> 
                                                    </SpecialDays> 
                                                </Calendar> 
                                            </telerik:RadDatePicker>
                                        </td>
                                        <td>
                                            
                                        </td>
                                        <td></td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <telerik:RadComboBox ID="RCGender" runat="server"  MarkFirstMatch="true" Width="100px" Filter="StartsWith" EmptyMessage="Gender">
                                                <Items>
                                                    <telerik:RadComboBoxItem Text="Male" Value="1" />
                                                    <telerik:RadComboBoxItem Text="Female" Value="2" />
                                                    <telerik:RadComboBoxItem Text="Other" Value="3" />
                                                </Items>
                                            </telerik:RadComboBox>
                                        </td>
                                        <td>
                                            <telerik:RadMaskedTextBox ID="RMCellNo" runat="server" Width="100%" EmptyMessage="Mobile No"
                                                Mask="(971)-#########">
                                            </telerik:RadMaskedTextBox>
                                        </td>
                                        <td>
                                            <telerik:RadTextBox ID="RTEmailNo" runat="server" EmptyMessage="Email">
                                            </telerik:RadTextBox>
                                        </td>
                                        <td>
                                            <telerik:RadComboBox ID="RCPatientType" runat="server"  MarkFirstMatch="true" Width="100%"  Filter="StartsWith" EmptyMessage="Patient Type">
                                            </telerik:RadComboBox>
                                        </td>
                                        <td>
                                            <asp:LinkButton ID="btnSavePatient" runat="server" OnClick="btnSavePatient_Click" Text="Add" AutoPostBack="true" ValidationGroup="Patient123">
                                            </asp:LinkButton>
                                        </td>
                                        <td></td>
                                    </tr>
                                </table>
                            </div>
                            <div id="dvAppointment" style="background-color:#e6e2e7;height:100%">
                                <table cellpadding="10" cellspacing="10" width="100%" >
                                <tr>
                                    <td Width="15%"></td>
                                    <td Width="34%"></td>
                                    <td Width="15%"></td>
                                    <td Width="34%"></td>
                                    <td Width="2%"></td>
                                </tr>
                                <tr>
                                    <td>Patient</td>
                                    <td>
                                            <telerik:RadComboBox ID="RCPatient" runat="server" MarkFirstMatch="true" Filter="Contains" AppendDataBoundItems="true"  
                                             DropDownAutoWidth="Enabled" EmptyMessage="Choose Patient" HighlightTemplatedItems="true">
                                            <HeaderTemplate>
                    

                           <asp:RequiredFieldValidator runat="server" ID="PatientValidator" ControlToValidate="RCPatient" InitialValue="0" 
                               EnableClientScript="true" Display="Dynamic" CssClass="rsValidatorMsg" />
                            <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>
                        
                
                        <span class="rsAdvResetExceptions">
                            <asp:LinkButton runat="server" ID="ResetExceptions" OnClick="ResetExceptions_OnClick" />
                        </span>
                        <telerik:RadSchedulerRecurrenceEditor runat="server" ID="AppointmentRecurrenceEditor" Visible="false"/>
                        <asp:HiddenField runat="server" ID="OriginalRecurrenceRule" />
                        <telerik:RadCalendar runat="server" ID="SharedCalendar" Skin='<%# Owner.Skin %>'
                            CultureInfo='<%# Owner.Culture %>' ShowRowHeaders="false" RangeMinDate="1900-01-01" Visible="false"/>
                    </asp:Panel>
                </div>
                <asp:Panel runat="server" ID="ButtonsPanel" CssClass="rsAdvancedSubmitArea">
                    <div class="rsAdvButtonWrapper">
                        <asp:LinkButton runat="server" ID="UpdateButton" CssClass="rsAdvEditSave" OnClick="UpdateButton_Click"  CausesValidation="true">
       <span><%= Owner.Localization.Save %></span>
                        </asp:LinkButton>
                        <asp:LinkButton runat="server" ID="CancelButton" CssClass="rsAdvEditCancel" CommandName="Cancel" OnClick="AdvancedEditCloseButton_Click"
                            CausesValidation="false" >
       <span><%= Owner.Localization.Cancel %></span>
                        </asp:LinkButton>
                    </div>
                    <asp:HiddenField ID="hdnLocationID" runat="server" />
                    <asp:HiddenField ID="hdnDepartmentID" runat="server" />
                    <asp:HiddenField ID="hdnTreeViewID" runat="server" />
                    <asp:HiddenField ID="hdnDoctorID" runat="server" />
                    <asp:HiddenField ID="hdnAppointmentID" runat="server" />
                    <asp:HiddenField ID="hdnSelectedDate" runat="server" />
                </asp:Panel>
            </telerik:RadPageView>
        </telerik:RadMultiPage>

where i add ajax request In RadScheduler page like 
<AjaxSettings>
    <telerik:AjaxSetting AjaxControlID="btnSavePatient">
        <UpdatedControls>
            <telerik:AjaxUpdatedControl ControlID="RCPatient" />
        </UpdatedControls>
    </telerik:AjaxSetting>
</AjaxSettings>

or 

in advance form control

<telerik:RadAjaxManager ID="ramAdvForm" runat="server" EnableScriptCombine="false">
<AjaxSettings>
    <telerik:AjaxSetting AjaxControlID="btnSavePatient">
        <UpdatedControls>
            <telerik:AjaxUpdatedControl ControlID="RCPatient" />
        </UpdatedControls>
    </telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>

or 

used normal ajax like 

<asp:UpdatePanel runat="server" UpdateMode="Conditional" ID="updatePanel1">
                                        <ContentTemplate>
                                            <telerik:RadComboBox ID="RCPatient" runat="server" MarkFirstMatch="true" Filter="Contains" AppendDataBoundItems="true"  
                                             DropDownAutoWidth="Enabled" EmptyMessage="Choose Patient" HighlightTemplatedItems="true">
                                            <HeaderTemplate>
                                                <table style="width: 450px" cellspacing="0" cellpadding="0">
                                                    <tr>
                                                        <td style="width: 200px;">First Name
                                                        </td>
                                                        <td style="width: 100px;">Last Name
                                                        </td>
                                                        <td style="width: 50px;">FileNo
                                                        </td>
                                                        <td style="width: 100px;">Mobile
                                                        </td>
                                                    </tr>
                                                </table>
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                                <table style="width: 450px" cellspacing="0" cellpadding="0">
                                                    <tr>
                                                        <td style="width: 200px;">
                                                            <%# DataBinder.Eval(Container, "Text")%>
                                                        </td>
                                                        <td style="width: 100px;">
                                                            <%# DataBinder.Eval(Container, "Attributes['LastName']")%>
                                                        </td>
                                                        <td style="width: 50px;">
                                                            <%# DataBinder.Eval(Container, "Attributes['FileNo']")%>
                                                        </td>
                                                        <td style="width: 100px;">
                                                            <%# DataBinder.Eval(Container, "Attributes['MobileNo']")%>
                                                        </td>                                                        
                                                    </tr>
                                                </table>
                                            </ItemTemplate>
                                        </telerik:RadComboBox>
                                        </ContentTemplate>    
                                        <Triggers>
                                            <asp:AsyncPostBackTrigger ControlID="btnSavePatient" EventName="Click" />        
                                        </Triggers>
                                     </asp:UpdatePanel>
i tried all but no luck.

Thanks in advance

Regards,
Danish  


3 Answers, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 26 Sep 2013, 08:09 AM
Hello,

Could you please clarify what kind of problem you face when you customize your advanced modal form using Ajax? For sample purposes I have attached a sample project containing custom advanced form with a RadComboBox and a link button. When user selects a different item the link button' text value will be changed with the selected item's text. Could you please clarify whether you are facing any issue with that sample project?

 

Regards,
Boyan Dimitrov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Danish
Top achievements
Rank 1
answered on 30 Sep 2013, 01:30 PM
Hi,

Thanks for your reply.In my case, I am using this commend <AdvancedForm Modal="true" /> and manipulate all my control in AdvancedForm.ascx  file. I am also using RadAjaxManagerProxy in .ascx file but nothing is working for me.But if i disable Ajax (with <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"  EnableAJAX="false">) commend everything is working fine but not ajax work and i want every functionality ajaxly. 

I hope you understand my question.


Thanks,
Danish
0
Boyan Dimitrov
Telerik team
answered on 03 Oct 2013, 10:37 AM
Hello Danish,

I have made some modifications in order to work as expected when you use RadAjaxmanagerProxy in your user control. I have wrapped the RadComboBox control and the link button in asp:panel control and changed the logic of finding the link button control in the RadComboBox selected index changed server-side event handler. Please find attached a modified version of the project.

Regards,
Boyan Dimitrov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Scheduler
Asked by
Danish
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Danish
Top achievements
Rank 1
Share this question
or