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

it's possible to have ResourceTypes not empty

2 Answers 75 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
CYFL
Top achievements
Rank 1
CYFL asked on 10 Nov 2010, 10:12 AM
Hi !

I have a ResourceType combo and i woul'd like to know if it's possible to set the a default value or not save with no choice !
<telerik:RadScheduler ID="RadScheduler1" runat="server"
           DataDescriptionField="COMM_ALMANACH" DataEndField="DF_ALMANACH"
           DataKeyField="ID_ALMANACH" DataSourceID="EntityDataSource2"
           DataStartField="DD_ALMANACH" DataSubjectField="L_ALMANACH"
           EnableDescriptionField="True" Culture="fr-FR">
           <ResourceTypes>
               <telerik:ResourceType DataSourceID="EntityDataSource1"
                   ForeignKeyField="ID_DOMAINE" KeyField="ID_DOMAINE" Name="le domaine"
                   TextField="C_DOMAINE"  />
           </ResourceTypes>
       </telerik:RadScheduler>


Thanks a lot !
 

2 Answers, 1 is accepted

Sort by
0
Accepted
Veronica
Telerik team
answered on 16 Nov 2010, 08:27 AM
Hello CYFL,

Please accept my apologies for the late reply.

You can subscribe to OnAppointmentInsert and check if the resource of the appointment is null. If so - you can stop the inserting of the appointment and display an appropriate message. Here's a sample code:

protected void RadScheduler1_AppointmentInsert(object sender, AppointmentInsertEventArgs e)
    {
        if (e.Appointment.Resources.GetResourceByType("Calendar") == null)
        {
            e.Cancel = true;
            ScriptManager.RegisterStartupScript(Page, GetType(), "alert", "alert('Please select a calendar!');", true);
        }
    }

In my case I have resource with name "Calendar". You can replace it with your name: "le domaine".

Please let me know if this was helpful.

All the best,
Veronica Milcheva
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
CYFL
Top achievements
Rank 1
answered on 16 Nov 2010, 10:07 AM

Great it's work !
Thank you so much !!!!
Tags
Scheduler
Asked by
CYFL
Top achievements
Rank 1
Answers by
Veronica
Telerik team
CYFL
Top achievements
Rank 1
Share this question
or