how can i drag and drop event and store it in database using asp.net
The following tutorial shows how to use external drag and drop in a real-world scenario:
Thank you for your great answer sir!
new DataManager().CreateAssignment(e.NewStart, e.NewEnd, Convert.ToInt32(e.NewResource), Convert.ToInt32(e.Value));
DayPilotScheduler1.UpdateWithMessage("The assignment has been created.");
// moving an existing assignment
new DataManager().MoveAssignment(Convert.ToInt32(e.Value), e.NewStart, e.NewEnd, e.NewResource);
DayPilotScheduler1.UpdateWithMessage("The assignment has been updated.");
only this part is enough to drag external events and store in database?
Yes, the external drag and drop will fire the standard EventMove event.
is it possible to drag and drop the external events to the database without using popup
protected void DayPilotScheduler1_EventMove(object sender, DayPilot.Web.Ui.Events.EventMoveEventArgs e)
string id = e.Value;
DateTime start = e.NewStart;
DateTime end = e.NewEnd;
string resource = e.NewResource;
DbUpdateEvent(id, start, end);
DayPilotScheduler1.DataSource = DbGetEvents(DayPilotScheduler1.StartDate, DayPilotScheduler1.Days);
by using the above code, the events inside the scheduler is moving. but not the external events. can i please get the code for adding external events in database
If the event doesn't exist in the DB yet it can't be updated with DbUpdateEvent() because it does something like this:
UPDATE events SET start = @start, end = @end WHERE id = @id;
That's why the sample above detects the external drag and drop and creates the event instead of updating it.
But this depends on your architecture. As I noted, one of the options is to have the unscheduled events in the database already.
i do have the unscheduled events from database. but the problem is dragging and dropping unscheduled is not happenning