This example shows how to manage Scheduler resources in code (create, modify, delete selected resource).
The PopupMenuShowing event is handled to add custom commands:
private void schedulerControl1_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e) {
if (e.Menu.Id == DevExpress.XtraScheduler.SchedulerMenuItemId.DefaultMenu) {
SchedulerMenuItem itemNewResource = new SchedulerMenuItem("New Resource", OnAddResource);
SchedulerMenuItem itemEditResource = new SchedulerMenuItem("Edit Resource", OnEditResource);
SchedulerMenuItem itemDeleteResource = new SchedulerMenuItem("Delete Resource", OnDeleteResource);
int baseIndex = 4;
itemNewResource.BeginGroup = true;
e.Menu.Items.Insert(baseIndex, itemNewResource);
e.Menu.Items.Insert(baseIndex + 1, itemEditResource);
e.Menu.Items.Insert(baseIndex + 2, itemDeleteResource);
}
}
(you will be redirected to DevExpress.com to submit your response)