Nov 24, 2010, 1:31 PM
[CLOSED] How to add event from code behind button click (DirectEventArgs)
Hello Team,
I have page with Calendar,Collection Employees (combobox) and a buttton (Show Calendar).
I will select an employee from the combobox and click on the button to add the respective employee events to the calender.....
Please find my code below
Mohan
I have page with Calendar,Collection Employees (combobox) and a buttton (Show Calendar).
I will select an employee from the combobox and click on the button to add the respective employee events to the calender.....
Please find my code below
<ext:CalendarPanel ID="CalendarPanel1" runat="server" Region="Center" ActiveIndex="2" Border="false">
<EventStore ID="eventStore1" runat="server">
</EventStore>
</ext:CalendarPanel>
protected void btnShow_Click(object sender, DirectEventArgs e)
{
--- code to get a list of events for the employee
EventStore eventStore = (EventStore)this.CalendarPanel1.EventStore;
List<EmployeeEvents> lstEmpEvents = GetEmployeeEventsByEmployeeId(employeeId);
foreach (EmployeeEvents empEvent in lstEmpEvents )
{
Event myEvent = new Event();
myEvent.Title = empEvent.EventName;
myEvent.StartDate = empEvent.StartDate;
myEvent.EndDate = empEvent.EndDate;
eventStore.Events.Add(myEvent);
}
this.CalendarPanel1.DataBind();
}
RegardsMohan
Last edited by Daniil; Nov 26, 2010 at 3:43 PM.
Reason: Please use [CODE] tags, [CLOSED]