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

problem to rescue scheduler elements

4 Answers 93 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Luiz Carlos
Top achievements
Rank 1
Luiz Carlos asked on 01 Jul 2016, 09:50 PM

Hello,
I'm using advancedEditTemplate and I am unable to rescue the components inside us click and update events.

I have this code:

 

    <telerik:RadScheduler ID="RadSchedulerAgenda" runat="server"
        Localization-HeaderToday="Hoje"
        Localization-HeaderDay="Dia"
        Localization-HeaderWeek="Semana"
        Localization-ConfirmDeleteTitle="Cancelar Horário"
        Localization-ConfirmDeleteText="Deseja cancelar horário?" Height="100%" RowHeight="50px" Culture="pt-BR" Localization-HeaderMonth="Mês"
        Localization-AdvancedDescription="Descrição"
        Localization-AdvancedSubject="Assunto"
        Localization-AdvancedAllDayEvent="Todo o Dia"
        Localization-AdvancedStartTimeRequired="Inicio"
        Localization-AdvancedRecurrence="Evento Recorrente"
        Localization-AdvancedEditAppointment="Editar Agendamento"
        Localization-Save="Salvar"
        Localization-Cancel="Cancelar"
        Reminders-Enabled="false"
        ShowFooter="False"
        ShowAllDayRow="False"
        ShowNavigationPane="False"
        Skin="Bootstrap"
        DayStartTime="07:00:00"
        DayEndTime="19:00:00"
        WorkDayStartTime="07:00:00"
        WorkDayEndTime="19:00:00"
        DataKeyField="idAgendamento"
        DataSubjectField="Solicitacao.Protocolo"
        DataDescriptionField="Descricao"
        DataStartField="DataInicio"
        DataEndField="DataFim"
        AdvancedForm-EnableCustomAttributeEditing="true"
        AdvancedForm-Modal="true"
        AllowInsert="False"
        OnFormCreated="RadSchedulerAgenda_FormCreated"
        OnNavigationCommand="RadSchedulerAgenda_NavigationCommand"
        OnAppointmentDataBound="RadSchedulerAgenda_AppointmentDataBound"
        OnAppointmentClick="RadSchedulerAgenda_AppointmentClick"
        OnAppointmentDelete="RadSchedulerAgenda_AppointmentDelete"
        OnAppointmentUpdate="RadSchedulerAgenda_AppointmentUpdate" DisplayRecurrenceActionDialogOnMove="True" EnableCustomAttributeEditing="True">

        <AppointmentContextMenus>
            <telerik:RadSchedulerContextMenu runat="server" ID="SchedulerAppointmentContextMenu">
                <Items>
                    <telerik:RadMenuItem Text="Abrir" Value="CommandEdit">
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem IsSeparator="True">
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem Text="Categorize">
                        <Items>
                            <telerik:RadMenuItem Text="Não Atendido" Value="1">
                            </telerik:RadMenuItem>
                            <telerik:RadMenuItem Text="Na Recepção" Value="2">
                            </telerik:RadMenuItem>
                            <telerik:RadMenuItem Text="Em Atendimento" Value="3">
                            </telerik:RadMenuItem>
                            <telerik:RadMenuItem Text="Atendido" Value="4">
                            </telerik:RadMenuItem>
                        </Items>
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem IsSeparator="True">
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem Text="Delete" Value="CommandDelete" ImageUrl="https://safeweb.com.br/ecommerce/icons/deletered.png">
                    </telerik:RadMenuItem>
                </Items>
            </telerik:RadSchedulerContextMenu>
        </AppointmentContextMenus>

        <AdvancedEditTemplate>
            <div class="rsDialog rsAdvancedEdit rsAdvancedModal" style="position: relative">

                <div class="rsAdvTitle">
                    <h1 class="rsAdvInnerTitle">Visualizar Agendamento</h1>
                    <asp:LinkButton runat="server" ID="AdvancedEditCloseButton" CssClass="rsAdvEditClose" CommandName="Cancel" />
                </div>
                <div class="rsAdvContentWrapper">
                    <ul class="rfbGroup">
                        <li class="rfbRow">
                            <telerik:RadTextBox RenderMode="Lightweight" ID="Assunto_RadTextBox" runat="server" Width="100%" Label="Assunto : " CssClass="form-control" ReadOnly="true" Skin="Bootstrap" />
                        </li>
                        <li class="rfbRow">
                            <telerik:RadDatePicker RenderMode="Lightweight" ID="DtInicio_RadDatePicker" CssClass="toDate" Width="50%" runat="server" DateInput-Label="Data/Hora Inicio" Skin="Bootstrap" />
                            <telerik:RadTimePicker RenderMode="Lightweight" ID="HrInicio_RadTimePicker" runat="server" Skin="Bootstrap" TimeView-Interval="00:30" />
                        </li>
                        <li class="rfbRow">
                            <telerik:RadDatePicker RenderMode="Lightweight" ID="DtFim_RadDatePicker" CssClass="toDate" Width="50%" runat="server" DateInput-Label="Data/Hora Fim" Skin="Bootstrap" />
                            <telerik:RadTimePicker RenderMode="Lightweight" ID="HrFim_RadTimePicker" runat="server" Skin="Bootstrap" TimeView-Interval="00:30" />
                        </li>
                        <li class="rfbRow">
                            <telerik:RadTextBox RenderMode="Lightweight" ID="Nome_RadTextBox" runat="server" Width="100%" Label="Nome/Razão Social : " CssClass="form-control" ReadOnly="true" Skin="Bootstrap" />
                        </li>
                        <li class="rfbRow">
                            <telerik:RadTextBox RenderMode="Lightweight" ID="Documento_RadTextBox" runat="server" Width="100%" Label="Documento : " CssClass="form-control" ReadOnly="true" Skin="Bootstrap" />
                        </li>
                        <li class="rfbRow">
                            <telerik:RadTextBox RenderMode="Lightweight" ID="Email_RadTextBox" runat="server" Width="100%" Label="Email : " CssClass="form-control" ReadOnly="true" Skin="Bootstrap" />
                        </li>
                        <li class="rfbRow">
                            <telerik:RadTextBox RenderMode="Lightweight" ID="Telefone_RadTextBox" runat="server" Width="100%" Label="Telefone : " CssClass="form-control" ReadOnly="true" Skin="Bootstrap" />
                        </li>
                        <li class="rfbRow">
                            <telerik:RadTextBox RenderMode="Lightweight" ID="Produto_RadTextBox" runat="server" Width="100%" Label="Produto : " CssClass="form-control" ReadOnly="true" Skin="Bootstrap" />
                        </li>
                        <li class="rfbRow">
                            <telerik:RadComboBox RenderMode="Lightweight" ID="Atendente_RadComboBox" runat="server" EmptyMessage="Selecione o Atendente" Width="100%" Label="Atendente : " DataSourceID="SqlDataSourceAtendentes" DataValueField="idUsuario" DataTextField="Nome" Skin="Bootstrap" />
                        </li>
                        <li class="rfbRow">
                            <telerik:RadComboBox RenderMode="Lightweight" ID="Status_RadComboBox" runat="server" Width="100%" Label="Status : " DataSourceID="SqlDataSourceStatus" DataValueField="Value" DataTextField="Text" Skin="Bootstrap" />
                        </li>
                        <li class="rfbRow">
                            <telerik:RadTextBox RenderMode="Lightweight" ID="Observacao_RadTextBox" runat="server" TextMode="MultiLine" Width="100%" Label="Observação : " Skin="Bootstrap" BorderWidth="1px" />
                        </li>
                    </ul>

                    <asp:Panel runat="server" ID="Panel1" CssClass="rsAdvancedSubmitArea">
                        <div class="rsAdvButtonWrapper">
                            <asp:LinkButton CommandName="Update" runat="server" ID="LinkButton2" CssClass="rsAdvEditSave" Text="Salvar" />
                            <asp:LinkButton runat="server" ID="LinkButton3" CssClass="rsAdvEditCancel" CommandName="Cancel" Text="Cancelar" />
                        </div>
                    </asp:Panel>

                </div>
            </div>
        </AdvancedEditTemplate>

        <AppointmentTemplate>
            <asp:Label runat="server" ID="teste_lbl" Text='<%# Eval("Subject") %>'></asp:Label>
        </AppointmentTemplate>

        <ExportSettings>
            <Pdf PageTopMargin="1in" PageBottomMargin="1in" PageLeftMargin="1in" PageRightMargin="1in"></Pdf>
        </ExportSettings>

    </telerik:RadScheduler>

How do I get access to the elements?

Thanks in advance.

 

4 Answers, 1 is accepted

Sort by
0
Luiz Carlos
Top achievements
Rank 1
answered on 01 Jul 2016, 09:54 PM
I forgot to mention that I am trying to catch the events of the elements mentioned via server ..
0
Ivan Danchev
Telerik team
answered on 06 Jul 2016, 03:02 PM
Hello Luiz Carlos,

I am not sure whether you want to use the serve events of the controls embedded in the AdvancedEditTemplate or you want to access them in a Scheduler event. If it is the former, I'll use one of the ComboBoxes as an example: you can subscribe the ComboBox to its SelectedIndexChanged event and set its AutoPostBack property to "true":
AutoPostBack="true" OnSelectedIndexChanged="Status_RadComboBox_SelectedIndexChanged"

You can then handle the event on the server:
protected void Status_RadComboBox_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
{
    //...
}

If it you want to access the controls in a Scheduler event you can do so by subscribing to its FormCreated event and you would be able to access the control as shown below with the ComboBox:
protected void RadScheduler1_FormCreated(object sender, SchedulerFormCreatedEventArgs e)
{
    if (e.Container.Mode == SchedulerFormMode.AdvancedEdit)
    {
        RadComboBox statusCombo = (RadComboBox)e.Container.FindControl("Status_RadComboBox");
    }
}


Regards,
Ivan Danchev
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
Luiz Carlos
Top achievements
Rank 1
answered on 08 Jul 2016, 03:02 PM
Ivan hello!

My need is the second response from you.
My doubt is how to access the compondentes without using RadScheduler1_FormCreated event because I use the click event (OnAppointmentClick) and save (OnAppointmentUpdate) native telerik.

Before entering these events, always goes through RadScheduler1_FormCreated, I wonder how I access the components of my template in the click and update events.

Thank you
0
Ivan Danchev
Telerik team
answered on 12 Jul 2016, 12:38 PM
Hello Luiz Carlos,

Unfortunately, the controls from the AdvancedEditTemplate are not accessible in the AppointmentClick and AppointmentUpdate event handlers and FormCreated must be used if you want to access them.

Regards,
Ivan Danchev
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
Scheduler
Asked by
Luiz Carlos
Top achievements
Rank 1
Answers by
Luiz Carlos
Top achievements
Rank 1
Ivan Danchev
Telerik team
Share this question
or