Printable View
Hello!
Couldn't reproduce. Do you see any error in the console?
Try to use Store's Add method:
Code:cpAgenda.EventStore.Add(emPrueba);
Try the following:
Code:protected void cpAgenda_DayClick(object sender, DirectEventArgs e)
{
DateTime dt = new DateTime(2013, 10, 07, 1, 0, 0);
EventModel emPrueba = new EventModel();
emPrueba.EventId = 1001;
emPrueba.Title = "Titulo prueba";
emPrueba.StartDate = dt;
emPrueba.EndDate = dt.AddHours(2);
emPrueba.Notes = "Esto es una prueba de notas";
emPrueba.CalendarId = 1;
cpAgenda.EventStore.Add(emPrueba);
cpAgenda.EventStore.DataBind();
}
I think you should apply some CalendarId.
Code:emPrueba.CalendarId = 1;
Daniil the problem is my CalendarId, this is working thank you, but now, When I get a click again, It is not painting again, I only to test I use EventId with DateTime.Now.Second, the object it's good, but "cpAgenda.EventStore.Events.Count" is zero the second clic, I don't know if this es the problem or what is?
I don't see any problems. Can you say the steps to reproduce?
I used the following code to add:
Code:protected void cpAgenda_DayClick(object sender, DirectEventArgs e)
{
DateTime dt = new DateTime(2013, 10, 07, 1, 0, 0);
EventModel emPrueba = new EventModel();
emPrueba.EventId = DateTime.Now.Second;
emPrueba.CalendarId = 1;
emPrueba.Title = "Titulo prueba";
emPrueba.StartDate = Convert.ToDateTime(e.ExtraParams["StartDate"]);
emPrueba.EndDate = Convert.ToDateTime(e.ExtraParams["StartDate"]).AddHours(2);
emPrueba.Notes = "Esto es una prueba de notas";
cpAgenda.EventStore.Add(emPrueba);
}