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

Setting Resource Value in Code Behind

1 Answer 14 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Joseph
Top achievements
Rank 1
Joseph asked on 17 Sep 2012, 07:17 PM
How would one set the value for a resource in the code behind (specifically for the Simple Form, not the Advanced Form)

I've tried the following with no luck . . . .

public void RadScheduler1_AppointmentInsert(object sender, SchedulerCancelEventArgs e)
{
    if (e.Appointment.Attributes["Employee"] == string.Empty)
    {
        e.Appointment.Attributes["Employee"] = "555";
    }
}

1 Answer, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 19 Sep 2012, 11:01 AM
Hello Joseph,

Modifying an appointment attribute in the inline insert form("Simple Form") could be proceed in OnFormCreated event. Here you can find more information about this event and its properties.

The issue that you are having with setting a value to your appointment attribute seems to be caused by the "if statement". If an attribute is not exist its value is null which is different than String.Empty.

protected void RadScheeduler1_AppointmentInsert(object sender, SchedulerCancelEventArgs e)
    {
        if (e.Appointment.Attributes["Employee"] == null)
        {
            e.Appointment.Attributes["Employee"] = "444";
        }
    }

Hope this will be helpful.

Regards,
Boyan Dimitrov
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.
Tags
Scheduler
Asked by
Joseph
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Share this question
or