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

Server side AppointmentClick does not fire

3 Answers 68 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Karl
Top achievements
Rank 1
Karl asked on 27 Feb 2013, 11:49 AM
I need to be able to capture when a user clicks on an appointment and work with server side code when an appointment is selected in my RadScheduler. However, the onAppointmentClick never seems to fire. I have read other posts that suggest setting ReadOnly to true/false to see if that makes a difference, as well as setting AllowEdit on both the control and the appointments and yet nothing seems to make any difference. I have also read that this event is only raised when the user double clicks the appointment, but this doesn;t work either for me.

My scheduler is sat within an ASP.Net update panel and uses an ASP.Net ScriptManager, but apart from that, its all pretty basic with no javascript or anything.

Does anyone have any ideas why this doesn;t work for me that I haven't tried yet?

Thanks,
Karl

3 Answers, 1 is accepted

Sort by
0
Helen
Telerik team
answered on 01 Mar 2013, 12:10 PM
Hello Karl,

Please find attached a sample project, which works at our side.


Regards,
Helen
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.
0
Karl
Top achievements
Rank 1
answered on 04 Mar 2013, 03:24 PM
Thanks for your help. Your example does indeed work on my pc and this has highlighted that I may have an issue with the way I'm loading my data.

I've extracted your methods of populating resources and appointments into my Scheduler now, but am having issues when trying to store additional information along with my appointments, such as category (which CssClass to use) and other specific information, such as EventNo and number of delegates booked and tooltip information etc.

I have tried adding nodes and attributes to the xml, but these aren't available in the AppointmentCreated event handler which as far as I understand it, is where I would need to set the CssClass for the appointment?

The tooltip uses the appointment subject, even though I set it to use the Tooltip node. In my code below, "Event 1" is displayed for each appointment, rather than the ToolTip value.

Please let me know how I would store additional information and set the CssClass correctly for appointments using the XmlSchedulerProvider. Is there any reference to the nodes available to me in the XmlSchedulerProvider?

My xml file is shown below.
<?xml version="1.0" encoding="UTF-8"?>
<Appointments>
    <Resources>
        <Consultant>
            <Key>Con001</Key>
            <Text>Consultant 1</Text>
            <CssClass>EmployeeColour</CssClass>
        </Consultant>
        <Consultant>
            <Key>Con002</Key>
            <Text>Consultant 2</Text>
            <CssClass>AssociateColour</CssClass>
        </Consultant>
        <Consultant>
            <Key>Con003</Key>
            <Text>Consultant 3</Text>
            <CssClass>EmployeeColour</CssClass>
        </Consultant>
        <Consultant>
            <Key>Con004</Key>
            <Text>Consultant 4</Text>
            <CssClass>AssociateColour</CssClass>
        </Consultant>
        <Consultant>
            <Key>Con005</Key>
            <Text>Consultant 5</Text>
            <CssClass>EmployeeColour</CssClass>
        </Consultant>
        <Consultant>
            <Key>Con006</Key>
            <Text>Consultant 6</Text>
            <CssClass>PartnerColour</CssClass>
        </Consultant>
    </Resources>
    <Appointment>
        <ID>1</ID>
        <Subject>Event 1</Subject>
        <ToolTip>Event 1 - Day 1</ToolTip>
        <Start>2013-03-04T08:00Z</Start>
        <End>2013-03-04T18:00Z</End>
        <CssClass>rsCategoryRed</CssClass>
        <Resources>
            <Consultant Key="Con003"/>     
        </Resources>
    </Appointment>
    <Appointment>
        <ID>2</ID>
        <Subject>Event 1</Subject>
        <ToolTip>Event 1 - Day 2</ToolTip>
        <Start>2013-03-05T08:00Z</Start>
        <End>2013-03-05T18:00Z</End>
        <CssClass>rsCategoryRed</CssClass>
        <Resources>
            <Consultant Key="Con003"/>
        </Resources>
    </Appointment>
    <Appointment>
        <ID>3</ID>
        <Subject>Event 1</Subject>
        <ToolTip>Event 1 - Day 3</ToolTip>
        <Start>2013-03-06T08:00Z</Start>
        <End>2013-03-06T18:00Z</End>
        <CssClass>rsCategoryRed</CssClass>
        <Resources>
            <Consultant Key="Con003"/>
        </Resources>
    </Appointment>
</Appointments>
0
Karl
Top achievements
Rank 1
answered on 05 Mar 2013, 10:27 AM
Fixed it. If I add the attribute to the appointment in this manner it adds it to the xml and I am able to see this at run time...

Using this method I can add any number of custom attributes. I'm convinced I'd tried this, but I guess not!
<Attribute Key="EventNo" Value="EV001" />

Tags
Scheduler
Asked by
Karl
Top achievements
Rank 1
Answers by
Helen
Telerik team
Karl
Top achievements
Rank 1
Share this question
or