• About
    • Blog
    • Business Process
    • Charity Work
    • History
    • News
  • Services
    • Legacy System Support
    • Bespoke System Development
    • Web Design & Development
    • View all services
  • Products
  • Our work
    • Customers
    • Case Studies
  • Careers
  • Contact
Microsoft Partner - Application Development
20th April 2015

DevExpress XAF - Scheduler Control Change Event Display Text

DevExpress PSP Knowledge
DevExpress XAF - Scheduler Control Change Event Display Text

By default when using the Win Scheduler List Editor List Editor Type when viewing your Events using the Scheduler Control, the time of the Event will be shown along with the Subject and Location of your event, as seen below.



It may be required for the event preview within the Scheduler Control to show more information or different information about the event, the code snippet below examples changing the preview text to a custom field against our event class, it needs to be implemented within a View Controller in the Module.Win project.

using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Scheduler.Win;
using DevExpress.XtraScheduler;
 
/// <summary>
/// Scheduler View Controller
/// </summary>
public partial class SchedulerViewController : ObjectViewController<ListView, MyEventClass>

/// <summary> /// Initializes a new instance of the <see cref="SchedulerViewController"/> class. /// </summary> public SchedulerViewController()

this.InitializeComponent(); this.RegisterActions(this.components);

/// <summary> /// Called when [view controls created]. /// </summary> protected override void OnViewControlsCreated()

base.OnViewControlsCreated(); SchedulerListEditor listEditor = View.Editor as SchedulerListEditor; if (listEditor != null)

SchedulerControl scheduler = listEditor.SchedulerControl; if (scheduler != null)

scheduler.InitAppointmentDisplayText += new AppointmentDisplayTextEventHandler(this.SchedulerControl_InitAppointmentDisplayText);

/// <summary> /// Handles the AppointmentDisplayText event of the SchedulerControl control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="AppointmentDisplayTextEventArgs"/> instance containing the event data.</param> private void SchedulerControl_InitAppointmentDisplayText(object sender, AppointmentDisplayTextEventArgs e)

MyEventClass event = this.ObjectSpace.GetObjectByKey<MyEventClass>(e.Appointment.Id); if (event != null)

e.Text = string.Concat(event.MyCustomPreviewField);

The screenshot below shows how the above code snippet alters the event preview at runtime.



Share:
PSP IT Design & Development
About Us
  • Privacy Policy
  • History
  • Customers
  • News
  • Blogs
Services
  • Legacy System Modernisation
  • Website Design & Development
  • Bespoke Application Development
  • Outsource IT Strategy
  • All Services
Contact
  • 01775 722377
  • letstalk@psp-it.co.uk
  • Carver House, Apex Court, Spalding Office Park, Elsoms Way, Pinchbeck, Spalding,Lincolnshire, PE11 3UL

Terms & Conditions Privacy Policy

© PSP People Systems Process Ltd. 2022. All Rights Reserved.

MENU

MENU

  • About

    • Blog

    • Business Process

    • Charity Work

    • History

    • News

  • Services

    • Legacy System Support

    • Bespoke System Development

    • Web Design & Development

    • View all services

  • Products

  • Our work

    • Customers

    • Case Studies

  • Careers

  • Contact

© PSP People Systems Process Ltd. 2022. All Rights Reserved. Privacy Policy

give us a call
01775 722377
drop us an email