Giter Site home page Giter Site logo

devexpress-examples / scheduler-how-to-implement-the-fetchappointment-event-functionality-e4130 Goto Github PK

View Code? Open in Web Editor NEW
0.0 54.0 0.0 1.15 MB

Limit the number of appointments loaded into the Scheduler storage dynamically.

License: Other

C# 38.49% HTML 20.67% ASP.NET 0.80% Visual Basic .NET 40.04%
dotnet mvc-scheduler asp-net-mvc

scheduler-how-to-implement-the-fetchappointment-event-functionality-e4130's Introduction

Scheduler for ASP.NET MVC - How to implement the FetchAppointments delegate method

This example demonstrates how to implenent the FetchAppointmentsMethod delegate to dynamically limit the number of appointments loaded into the Scheduler storage. This approach can be useful when a scheduler contains a large amount of data, and only a small part of it needs to be loaded at one time.

Call Bind(FetchAppointmentsMethod) or Bind(FetchAppointmentsMethod, Object) method to bind the Scheduler component to an appointment data source modified dynamically. Use the FetchAppointmentsMethod delegate to limit the number of appointments loaded into the Scheduler storage. The Interval property specifies the visible time interval. You can use this argument to calculate a new time interval to query a data source for appointments. Fetched appointments are returned to the caller to populate the scheduler.

@Html.DevExpress().Scheduler(SchedulerSettingsHelper.CommonSchedulerSettings).Bind(Model.FetchAppointments, Model.Resources).GetHtml()
public static SchedulerDataObject DataObject {
    get {
        SchedulerDataObject sdo = new SchedulerDataObject();
        sdo.Appointments = GetAppointments();
        sdo.Resources = GetResources();
        sdo.FetchAppointments = FetchAppointmentsHelperMethod;
        return sdo;
    }
}
public static object FetchAppointmentsHelperMethod(FetchAppointmentsEventArgs args) {
    args.ForceReloadAppointments = true;
    SchedulingDataClassesDataContext db = new SchedulingDataClassesDataContext();
    return db.DBAppointments.Where(e => e.StartDate > args.Interval.Start && e.EndDate < args.Interval.End);
}

Files to Review

Documentation

scheduler-how-to-implement-the-fetchappointment-event-functionality-e4130's People

Contributors

devexpressexamplebot avatar lanadx 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

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.