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

AppointmentClick

3 Answers 116 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
datisgod
Top achievements
Rank 1
datisgod asked on 11 Oct 2007, 01:16 AM
this is loaddata() method,

private void loadData(int ResourceID) {

DataTable dtSource = RegistrationDB.GetWithStatusAndResource("A", ResourceID);

RSFilm.DataSource = dtSource;

RSFilm.DataStartField = "Registration_From";

RSFilm.DataEndField = "Registration_To";

RSFilm.DataKeyField = "Registration_ID";

RSFilm.DataSubjectField = "Film_Title";

RSFilm.CustomAttributeNames = new string[]{"Film_UniqueColor","Film_ID"};

RSFilm.DataBind();

}
}

How can i get "Film_ID" in

protected void RSFilm_AppointmentClick(object sender, SchedulerEventArgs e)

{

//Response.Write(e.Appointment.Attributes["Film_ID"].ToString());

}

3 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 11 Oct 2007, 09:50 AM
Hi Dao,

I don't see anything wrong with your code. However, there is a couple of things to consider:
 
  1. The AppointmentClick event fires when you double-click an appointment. We are aware that the name of the event might be a bit misleading, but we will remedy this once the beta state of the control is over.
  2. If you are using Ajax, the Response.Write method will not execute. You can use a debugger to see the value of the Custom attribute.


Kind regards,
Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
datisgod
Top achievements
Rank 1
answered on 12 Oct 2007, 06:42 AM

it will threw NullException if


Response.Write(e.Appointment.Attributes["Film_ID"].ToString());

but in

 
protected void RSFilm_AppointmentCreated(object sender, AppointmentCreatedEventArgs e){
 Response.Write(e.Appointment.Attributes["Film_UniqueColor"]);
}

is OK
:)

0
Peter
Telerik team
answered on 12 Oct 2007, 09:36 AM
Hello Dao,

We couldn't reproduce the problem locally. Please, find attached our test project (Default2.aspx) and let us know if there is something different in your case. If the problem persists, please, open a support ticket and send us a simple project demonstrating the issue.


Kind regards,
Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Scheduler
Asked by
datisgod
Top achievements
Rank 1
Answers by
Peter
Telerik team
datisgod
Top achievements
Rank 1
Share this question
or