Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DxScheduler.SelectedAppointment Property

Specifies the selected appointment.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[Parameter]
public DxSchedulerAppointmentItem SelectedAppointment { get; set; }

#Property Value

Type Description
DxSchedulerAppointmentItem

An object that stores the selected appointment.

#Remarks

When a user selects an appointment (clicks it), the Scheduler displays a tooltip with additional information about this item.

Selected Appointment

To select an appointment from code, use the SelectedAppointment property. The following code selects an appointment with the specified identifier (1) when the Scheduler appears for the first time.

<DxScheduler DataStorage="@DataStorage" @bind-SelectedAppointment="@SelectedAppointment">
    <DxSchedulerWeekView ShowWorkTimeOnly="true" />
</DxScheduler>

@code {
  DxSchedulerAppointmentItem SelectedAppointment { get; set; }

  DxSchedulerDataStorage DataStorage = new DxSchedulerDataStorage() {
    AppointmentsSource = AppointmentCollection.GetAppointments(),
    AppointmentMappings = new DxSchedulerAppointmentMappings() {
      Type = "AppointmentType",
      Start = "StartDate",
      End = "EndDate",
      Subject = "Caption",
      AllDay = "AllDay",
      Location = "Location",
      Description = "Description",
      LabelId = "Label",
      StatusId = "Status",
      RecurrenceInfo = "Recurrence",
      Id = "Id"
    }
  };

  protected override void OnInitialized() {
    SelectedAppointment = DataStorage.GetAppointmentItemById(1);
  }
}

Handle the SelectedAppointmentChanged event to track selection changes.

See Also