Event
Namespace: Wisej.Web.Ext.FullCalendar
Assembly: Wisej.Web.Ext.FullCalendar (4.1.0.0)
Represents an event in the FullCalendar control.
- C#
- VB.NET
public class Event
Public Class [Event]
Add events to the calendar using Events. Once an event belongs to a calendar, changing any of its properties fires EventChanged and reloads the events on the client.
Example:
Creating a timed event and an all-day event:
var meeting = new Event("m42", new DateTime(2026, 10, 7, 14, 0, 0), TimeSpan.FromHours(1))
{
Title = "Budget meeting",
ToolTipText = "Room 3, bring the Q3 figures",
BackgroundColor = Color.DarkOrange
};
this.fullCalendar1.Events.Add(meeting);
this.fullCalendar1.Events.Add(new Event(new DateTime(2026, 10, 9)) { Title = "Release day" });
Constructors
Event()
Constructs a new instance of Event.
Event(id)
Constructs a new instance of Event.
| Name | Type | Description |
|---|---|---|
| id | String | A string that represents the ID of this event. |
Throws:
- ArgumentNullException id is null or empty.
Event(day)
Constructs a new instance of an all-day Event.
Event(start, end)
Constructs a new instance of Event.
| Name | Type | Description |
|---|---|---|
| start | DateTime | The starting DateTime date and time of the event. |
| end | DateTime | The ending DateTime date and time of the event. |
Event(start, duration)
Constructs a new instance of Event.
| Name | Type | Description |
|---|---|---|
| start | DateTime | The starting DateTime date and time of the event. |
| duration | TimeSpan | The TimeSpan duration of the event. |
Event(id, day)
Constructs a new instance of an all-day Event.
| Name | Type | Description |
|---|---|---|
| id | String | A string that represents the ID of this event. |
| day | DateTime | The DateTime date of the all-day event. |
Throws:
- ArgumentNullException id is null or empty.
Event(id, start, end)
Constructs a new instance of Event.
| Name | Type | Description |
|---|---|---|
| id | String | A string that represents the ID of this event. |
| start | DateTime | The starting DateTime date and time of the event. |
| end | DateTime | The ending DateTime date and time of the event. |
Throws:
- ArgumentNullException id is null or empty.
Event(id, start, duration)
Constructs a new instance of Event.
| Name | Type | Description |
|---|---|---|
| id | String | A string that represents the ID of this event. |
| start | DateTime | The starting DateTime date and time of the event. |
| duration | TimeSpan | The TimeSpan duration of the event. |
Throws:
- ArgumentNullException id is null or empty.
Properties
AllDay
Boolean: Returns or sets whether this is an all-day event.
The constructors that take a single day create all-day events. The value is updated when the user drags the event in or out of the all-day slot.
BackgroundColor
Color: Returns or sets the background color for this event.
When empty, the event uses EventBackgroundColor.
BorderColor
Color: Returns or sets the border color for this event.
When empty, the event uses EventBorderColor.
ClassName
String: Returns or sets the CSS class name (or several names separated by spaces) that will be attached to this event's element.
The CSS classes must be defined in a style sheet loaded by the application.
Example:
Styling an event with a custom CSS class:
// .urgent { font-weight: bold; } is defined in a css file loaded by the application.
this.fullCalendar1.Events["m42"].ClassName = "urgent";
Editable
Boolean: Returns or sets whether the event can be dragged and resized by the user.
The default is true.
End
DateTime: Returns or sets the end date/time of this event.
The end is exclusive: an all-day event that lasts two days, from October 5 to October 6, ends on October 7. The value is updated when the user drags or resizes the event. Changing the value of an event that belongs to a calendar fires EventChanged and reloads the events on the client.
Example:
Creating a three day all-day event:
var trip = new Event(new DateTime(2026, 10, 5)) { Title = "Trade fair" };
trip.End = new DateTime(2026, 10, 8);
this.fullCalendar1.Events.Add(trip);
Id
String: Returns or sets the unique ID for this event.
An empty string is converted to null. Events added to Events without an ID receive an automatic ID ("event_1", "event_2", ...). Adding an event with the same ID of an event already in the collection replaces the existing event. The ID identifies the event in the calendar's events such as EventClick, and in virtual mode it's passed to RetrieveVirtualEvent.
ResourceId
String: Returns or sets the id of the SchedulerResource associated to this event.
Must match the Id of one of the resources in Resources. The value is updated when the user drags the event to a different resource.
Start
DateTime: Returns or sets the start date/time of this event.
The value is updated when the user drags or resizes the event; in that case EventChanged is fired with the previous value. Changing the value of an event that belongs to a calendar fires EventChanged and reloads the events on the client.
TextColor
Color: Returns or sets the text color for this event.
When empty, the event uses EventTextColor.
Title
String: Returns or sets the title of this event.
ToolTipText
String: Returns or sets the text that appears when the mouse pointer hovers over the event.
3.5.13+ (Default: null)
Value: The text that appears when the mouse pointer hovers over a Event.
The ToolTip is displayed only when ShowEventToolTips is true. When the value is null, the ToolTip shows the Title.
UserData
Object: Returns a dynamic object that can be used to store custom data.
The object is created the first time the property is read.
Example:
Storing the database key of an appointment:
var ev = this.fullCalendar1.Events.Add(new DateTime(2026, 10, 7, 9, 0, 0), TimeSpan.FromHours(1));
ev.Title = "Dentist";
ev.UserData.AppointmentId = 1234;
Reading the value when the event is clicked:
private void fullCalendar1_EventClick(object sender, EventClickEventArgs e)
{
int id = e.Event.UserData.AppointmentId ?? 0;
OpenAppointment(id);
}