Selection Service

  • 2 minutes to read

The ISelectionService interface in the XtraScheduler provides control over the selection in the time cell area. It has the following delegates:

You can get the ISelectionService, as described in Introduction to Services in XtraScheduler document, use it, or substitute your own custom descendant.

The simplest technique to use the Selection service is to get access to its properties and methods via the SchedulerControl.Services.Selection property wrapper, as illustrated below.

public partial class _Default : System.Web.UI.Page {
     protected override void OnInit(EventArgs e) {
        base.OnInit(e);
        ASPxScheduler1.Services.Selection.SelectionChanged += 
            new EventHandler(Selection_SelectionChanged);
     }   
// ...

    void Selection_SelectionChanged(object sender, EventArgs e) {
        string s = ASPxScheduler1.Services.Selection.SelectedInterval.ToString();
    // ...
    }
// ...

    protected void Button1_Click(object sender, EventArgs e) {
        ASPxScheduler1.Services.Selection.SetSelection(new TimeInterval(new DateTime(2009, 1, 1), 
            new DateTime(2009, 1, 4)), ASPxScheduler1.Storage.Resources[1]);
    }
// ...
}
NOTE

The selecion is the server-side selection, not the client selection. To handle selection changes on the client side, use the ASPxClientScheduler.SelectionChanged event.

See Also