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

CustomAttributes

3 Answers 89 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Ramie C
Top achievements
Rank 1
Ramie C asked on 26 Mar 2010, 06:07 PM
Hello,

I am trying to create two custom attributes of which are named "PublishAt" and "RemoveAt" they are both DateTime's. So far here is my code:

<telerik:RadScheduler ID="RadScheduler1" EnableCustomAttributeEditing="True"
        CustomAttributeNames="PublishAt, RemoveAt">
        <AdvancedForm Modal="true" />
       
        ...
       
        <TimeSlotContextMenuSettings EnableDefault="true" />
        <AppointmentContextMenuSettings EnableDefault="true" />
</telerik:RadScheduler>

<asp:EntityDataSource runat="server" ID="EntityDataSource1" ... EntitySetName="Notices" EnableDelete="true"
        EnableInsert="true" EnableUpdate="true" OnInserting="EntityDataSource1_Inserting">
        <UpdateParameters>

            ...

            <asp:Parameter Name="PublishAt" Type="DateTime" />
            <asp:Parameter Name="RemoveAt" Type="DateTime" />
        </UpdateParameters>
        <InsertParameters>

            ...

            <asp:Parameter Name="PublishAt" Type="DateTime" />
            <asp:Parameter Name="RemoveAt" Type="DateTime" />
        </InsertParameters>
</asp:EntityDataSource>
The main problem with this is for one, the fields for "PublishAt" and "RemoveAt" do show up in the form, but they appear as textboxes and I wish for them to be formatted as the default "Start" and "End" properties. What is the best way to do this?

Another question I have is, what would be the best way to make it so that "PublishAt" and "RemoveAt" work so that an end-user can only see scheduled events once the "PublishAt" time has passed and they can not see scheduled events after the "RemoveAt" time has passed?

Hopefully I've included all the details in the code required. If anything else is necessary please let me know.

Thanks

Ramie

EDIT: If anyone thinks I am asking too much, could you perhaps just tell me how to create my own DateTime form?

3 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 29 Mar 2010, 03:15 PM
Hello Ramie C,

Your first requirement can be achieved with the help of the advanced templates. Please, use the following demo for reference:
http://demos.telerik.com/aspnet-ajax/scheduler/examples/advancedformtemplate/defaultcs.aspx

As for the second requirement, you can access the custom attributes' values in AppointmentDataBound and set the appointment's Visible property conditionally.


All the best,
Peter
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Ramie C
Top achievements
Rank 1
answered on 29 Mar 2010, 06:46 PM
For some clarity here, would my whole advanced form have to be custom in order to add this specific DateTime field? The way the example shows is very confusing to me. When I originally made this I used a CustumAttribute in the RadScheduler. This worked fine but I still wanted it to emulate the "Start" and "End" fields. Should I be using a RadDateTimePicker?

Would it be possible to get an example?
0
Accepted
Peter
Telerik team
answered on 30 Mar 2010, 10:11 AM
Hi Ramie C,

The default behavior of RadScheduler is to display custom attributes in RadTextBox controls. If you need to overwrite this and display the values using RadDate/TimePicker controls, then yes, you need to use the advanced templates as shown in the demo I referred you to.


Cheers,
Peter
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Scheduler
Asked by
Ramie C
Top achievements
Rank 1
Answers by
Peter
Telerik team
Ramie C
Top achievements
Rank 1
Share this question
or