Giter Site home page Giter Site logo

devexpress-examples / scheduler-how-to-implement-a-custom-edit-appointment-form-with-custom-fields-e4520 Goto Github PK

View Code? Open in Web Editor NEW
0.0 55.0 2.0 3.22 MB

Use the SetAppointmentFormTemplateContent method to create a custom appointment form.

License: Other

C# 24.61% HTML 54.45% ASP.NET 0.14% Visual Basic .NET 20.80%
dotnet mvc-scheduler asp-net-mvc appointment template

scheduler-how-to-implement-a-custom-edit-appointment-form-with-custom-fields-e4520's Introduction

Scheduler for ASP.NET MVC - How to implement a custom edit appointment form

This example demonstrates how to use the SetAppointmentFormTemplateContent method to create a custom appointment form.

Overview

Call the control's MVCxSchedulerOptionsForms.SetAppointmentFormTemplateContent method to add a custom appointment form to the SchedulerPartial view.

settings.OptionsForms.SetAppointmentFormTemplateContent(c => {
    var container = (CustomAppointmentTemplateContainer)c;
    var schedule = ViewData["EditableSchedule"] != null
        ? (Schedule)ViewData["EditableSchedule"]
        : new Schedule() {
            ID = container.Appointment.Id == null ? -1 : (int)container.Appointment.Id,
            <!-- ... -->
        };
    
    ViewBag.DeleteButtonEnabled = container.CanDeleteAppointment;
    ViewBag.IsRecurring = container.Appointment.IsRecurring;
    ViewBag.AppointmentRecurrenceFormSettings = CreateAppointmentRecurrenceFormSettings(container);

    ViewBag.ResourceDataSource = container.ResourceDataSource;
    ViewBag.StatusDataSource = container.StatusDataSource;
    ViewBag.LabelDataSource = container.LabelDataSource;
    ViewBag.ReminderDataSource = container.ReminderDataSource;

    Html.RenderPartial("CustomAppointmentFormPartial", schedule);
});

Create an AppointmentFormTemplateContainer to add custom fields to your appointment form and handle the control's server-side ASPxScheduler.AppointmentFormShowing event to replace the default container with the custom container.

settings.AppointmentFormShowing = (sender, e) => {
    var scheduler = sender as MVCxScheduler;
    if (scheduler != null)
        e.Container = new CustomAppointmentTemplateContainer(scheduler);
};

Files to Review

Documentation

More Examples

scheduler-how-to-implement-a-custom-edit-appointment-form-with-custom-fields-e4520's People

Contributors

devexpressexamplebot avatar elenapeskova avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.