[CLOSED] Add event from directevent in CalendarPanel

Page 1 of 2 12 LastLast
  1. #1

    [CLOSED] Add event from directevent in CalendarPanel

    Last edited by Baidaly; Oct 08, 2013 at 10:37 PM. Reason: [CLOSED]
  2. #2
    Hello!

    Couldn't reproduce. Do you see any error in the console?
  3. #3
  4. #4
    Try to use Store's Add method:

    cpAgenda.EventStore.Add(emPrueba);
  5. #5
    Quote Originally Posted by Baidaly View Post
    Try to use Store's Add method:

    cpAgenda.EventStore.Add(emPrueba);


    This is not working Baidaly, It is not painting the event.
  6. #6
    Try the following:

    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();
    }
  7. #7
    I think you should apply some CalendarId.
    emPrueba.CalendarId = 1;
  8. #8
    Quote Originally Posted by Daniil View Post
    I think you should apply some CalendarId.
    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?
  9. #9
    I don't see any problems. Can you say the steps to reproduce?

    I used the following code to add:

    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);
    }
  10. #10
    Quote Originally Posted by osef View Post
    but "cpAgenda.EventStore.Events.Count" is zero the second click
    An EventStore's Add method doesn't add an event into its Events collection. Moreover, the Events collection is not maintained during DirectEvents. It is only used to bind initial events.
Page 1 of 2 12 LastLast

Similar Threads

  1. [CLOSED] Add Event in a EventStore in a CalendarPanel
    By FpNetWorth in forum 1.x Premium Help
    Replies: 1
    Last Post: Aug 14, 2012, 12:29 PM
  2. Replies: 1
    Last Post: May 02, 2012, 2:40 PM
  3. CalendarPanel + Color for event
    By Ch3wbi in forum 1.x Help
    Replies: 4
    Last Post: Jan 05, 2012, 1:08 PM
  4. CalendarPanel and Event
    By gidi in forum 1.x Help
    Replies: 0
    Last Post: Aug 06, 2011, 8:17 PM
  5. Replies: 2
    Last Post: Jun 16, 2011, 1:41 AM

Tags for this Thread

Posting Permissions