No data for some custom attributes on insert/edit

4 posts, 0 answers
  1. Mike
    Mike avatar
    59 posts
    Member since:
    Jan 2008

    Posted 19 Mar 2012 Link to this post

    Hello,

    I'm using the scheduler with a few custom attributes to handle some additional fields. Here's an example below.

    When I perform the insert (the edit works the same way), I am handling the "AppointmentInsert" event and accessing the values with e.Appointment.Attributes("CustomAttribute").

    For the AdminNotes and PublicNotes, this gets a value, for the AllocationGroupID and SlotCode, it just comes back as an empty string. Everything is otherwise identical and I can't figure it out here...

    Anybody have any ideas?

    Thanks,

    Mike
    Private Sub roomSlots_AppointmentInsert(sender As Object, e As Telerik.Web.UI.AppointmentInsertEventArgs) Handles roomSlots.AppointmentInsert
        Dim newSlot As New ProgramSlotInfo
        Dim ctlSlots As New ProgramSlotController
        With newSlot
            .ConferenceID = ConferenceID
            .StartTime = e.Appointment.Start
            .EndTime = e.Appointment.End
            .LocationRoomID = LocationRoomID
            .SlotCode = e.Appointment.Attributes("SlotCode")
            .AdminNotes = e.Appointment.Attributes("AdminNotes")
            .PublicNotes = e.Appointment.Attributes("PublicNotes")
            .AllocationGroupID = e.Appointment.Attributes("AllocationGroupID")
        End With
        ctlSlots.AddProgramSlot(newSlot)
    End Sub


    <telerik:RadScheduler runat="server" ID="roomSlots" AllowEdit="True" AllowDelete="True"
        AllowInsert="True" EnableDatePicker="False" SelectedView="WeekView" ShowAllDayRow="False"
        Width="100%" DataKeyField="ProgramSlotID"
        DataSubjectField="SlotCode" DataStartField="StartTime" DataEndField="EndTime" StartInsertingInAdvancedForm="true"
        EnableCustomAttributeEditing="true" CustomAttributeNames="PublicNotes,SlotCode,AdminNotes,AllocationGroupID" MinutesPerRow="60">
        <AdvancedInsertTemplate>
            <h2 class="dnnFormSectionHead"><asp:Label runat="server" ID="lblAddSlotHeader" resourcekey="AddSlotHeader" Text="Add New Slot"></asp:Label></h2>
            <div class="dnnForm">
                <div class="dnnFormItem">
                    <dnn:label runat="server" id="lblStartTime" text="Start" resourcekey="StartLabel"></dnn:label>
                    <telerik:RadDateTimePicker runat="server" ID="startTime" SelectedDate='<%#bind("Start") %>' TimeView-Interval="00:15:00" TimeView-Columns="4" TimeView-StartTime="6:00:00"></telerik:RadDateTimePicker>
                </div>
                <div class="dnnFormItem">
                    <dnn:label runat="server" id="lblEndTime" text="End" resourcekey="EndLabel"></dnn:label>
                    <telerik:RadDateTimePicker runat="server" ID="endTime" SelectedDate='<%#bind("End") %>' TimeView-Interval="00:15:00" TimeView-Columns="4" TimeView-StartTime="6:00:00"></telerik:RadDateTimePicker>
                </div>
                <div class="dnnFormItem">
                    <dnn:label runat="server" id="lblSlotCode" text="Slot Code" resourcekey="SlotCodeLabel"></dnn:label>
                    <asp:TextBox runat="server" ID="txtSlotCode" Text='<%# Bind("SlotCode") %>'></asp:TextBox>
                </div>
                <div class="dnnFormItem">
                    <dnn:label runat="server" id="lblAllocationGroup" text="Allocation Group" resourcekey="AllocationGroupLabel"></dnn:label>
                    <telerik:RadComboBox runat="server" ID="cboAllocationGroup" DataTextField="GroupName" DataValueField="AllocationGroupID" DataSourceID="dsAllocationGroups" selectedValue='<%#bind("AllocationGroupID") %>'></telerik:RadComboBox>
                </div>
                <div class="dnnFormItem">
                    <dnn:label runat="server" id="lblPublicNotes" text="Public Notes" resourcekey="PublicNotesLabel"></dnn:label>
                    <asp:TextBox runat="server" ID="txtPublicNotes" TextMode="MultiLine" Text='<%#Bind("PublicNotes") %>'></asp:TextBox>
                </div>
                <div class="dnnFormItem">
                    <dnn:label runat="server" id="lblAdminNotes" text="Administrative Notes" resourcekey="AdminNotesLabel"></dnn:label>
                    <asp:TextBox runat="server" ID="TextBox1" TextMode="MultiLine" Text='<%#Bind("AdminNotes") %>'></asp:TextBox>
                </div>
     
                <asp:LinkButton runat="server" ID="lnkCreateSlot" CommandName="Insert" Text="Create Slot" CssClass="dnnPrimaryAction"></asp:LinkButton>
                <asp:LinkButton runat="server" ID="lnkCancelInsert" CommandName="Cancel" Text="Cancel" CssClass="dnnSecondaryAction"></asp:LinkButton>
            </div>
        </AdvancedInsertTemplate>
  2. Ivana
    Admin
    Ivana avatar
    657 posts

    Posted 22 Mar 2012 Link to this post

    Hi Mike,

    I have tested the following definition of RadScheduler bound to XML provider and everything works fine.  All the information regarding the custom attributes is passed to the AppointmentInsert arguments on the server:
    <telerik:RadScheduler runat="server" ID="roomSlots" AllowEdit="True" AllowDelete="True"
        AllowInsert="True" EnableDatePicker="False" SelectedView="WeekView" ShowAllDayRow="False"
        Width="100%" _DataKeyField="ProgramSlotID" _DataSubjectField="SlotCode" _DataStartField="StartTime"
        _DataEndField="EndTime" StartInsertingInAdvancedForm="true" EnableCustomAttributeEditing="true"
        CustomAttributeNames="PublicNotes,SlotCode,AdminNotes,AllocationGroupID" MinutesPerRow="60"
        OnAppointmentInsert="roomSlots_AppointmentInsert">
    <%--    <AdvancedInsertTemplate>
            <h2 class="dnnFormSectionHead">
                <asp:Label runat="server" ID="lblAddSlotHeader" Text="Add New Slot"></asp:Label></h2>
            <div class="dnnForm">
                <div class="dnnFormItem">
                    <asp:Label runat="server" ID="lblStartTime" Text="Start"></asp:Label>
                    <telerik:RadDateTimePicker runat="server" ID="startTime" SelectedDate='<%#bind("Start") %>'
                        TimeView-Interval="00:15:00" TimeView-Columns="4" TimeView-StartTime="6:00:00">
                    </telerik:RadDateTimePicker>
                </div>
                <div class="dnnFormItem">
                    <asp:Label runat="server" ID="lblEndTime" Text="End"></asp:Label>
                    <telerik:RadDateTimePicker runat="server" ID="endTime" SelectedDate='<%#bind("End") %>'
                        TimeView-Interval="00:15:00" TimeView-Columns="4" TimeView-StartTime="6:00:00">
                    </telerik:RadDateTimePicker>
                </div>
                <div class="dnnFormItem">
                    <asp:Label runat="server" ID="lblSlotCode" Text="Slot Code"></asp:Label>
                    <asp:TextBox runat="server" ID="txtSlotCode" Text='<%# Bind("SlotCode") %>'></asp:TextBox>
                </div>
                <div class="dnnFormItem">
                    <asp:Label runat="server" ID="lblAllocationGroup" Text="Allocation Group" resourcekey="AllocationGroupLabel">
                    </asp:Label>
                    <telerik:RadComboBox runat="server" ID="cboAllocationGroup" DataTextField="GroupName"
                        DataValueField="AllocationGroupID" DataSourceID="dsAllocationGroups" SelectedValue='<%#bind("AllocationGroupID") %>'>
                    </telerik:RadComboBox>
                </div>
                <div class="dnnFormItem">
                    <asp:Label runat="server" ID="lblPublicNotes" Text="Public Notes" resourcekey="PublicNotesLabel">
                    </asp:Label>
                    <asp:TextBox runat="server" ID="txtPublicNotes" TextMode="MultiLine" Text='<%#Bind("PublicNotes") %>'></asp:TextBox>
                </div>
                <div class="dnnFormItem">
                    <asp:Label runat="server" ID="lblAdminNotes" Text="Administrative Notes" resourcekey="AdminNotesLabel">
                    </asp:Label>
                    <asp:TextBox runat="server" ID="TextBox1" TextMode="MultiLine" Text='<%#Bind("AdminNotes") %>'></asp:TextBox>
                </div>
                <asp:LinkButton runat="server" ID="lnkCreateSlot" CommandName="Insert" Text="Create Slot"
                    CssClass="dnnPrimaryAction"></asp:LinkButton>
                <asp:LinkButton runat="server" ID="lnkCancelInsert" CommandName="Cancel" Text="Cancel"
                    CssClass="dnnSecondaryAction"></asp:LinkButton>
            </div>
        </AdvancedInsertTemplate>--%>
    </telerik:RadScheduler>

    Am I missing something?

    Greetings,
    Ivana
    the Telerik team
    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 their blog feed now.
  3. Bhaskara Rao
    Bhaskara Rao avatar
    2 posts
    Member since:
    Nov 2012

    Posted 23 Nov 2012 Link to this post

    I want to Insert, Update and delete the data from radscheduler i have some problem with my code please help me and post the code here
    Thanks
    Bhaskar
  4. Plamen
    Admin
    Plamen avatar
    2958 posts

    Posted 28 Nov 2012 Link to this post

    Hello Bhaskar,

     
    Would you please specify what kind of binding and DataSource are you using because there are different scenarios with RadScheduler(you can see different way of binding here)? This way we could be more helpful with a sample project. 

    All the best,
    Plamen
    the Telerik team
    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 their blog feed now.
Back to Top