Tab
A newer version of this page is available. Switch to the current version.

ASPxDateEdit.PopupCalendarOwnerID Property

Gets or sets the ID of a date editor whose popup window (with a calendar and a time edit) should be used by the current date editor.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v18.2.dll

Declaration

[DefaultValue("")]
public string PopupCalendarOwnerID { get; set; }
<DefaultValue("")>
Public Property PopupCalendarOwnerID As String

Property Value

Type Default Description
String

String.Empty

A string value specifying the donor date editor's ID.

Remarks

Editors of the ASPxDateEdit type enable an individual date editor's popup calendar (and a time edit if it is visible) and its settings to be shared between several date editors. This feature allows you to decrease the size of the HTML code rendered into the web page by date editors, since a popup window is rendered only once, and can then be used (invoked) by all date editors on the page.

Use the PopupCalendarOwnerID property to refer to a date editor control whose popup calendar should be used by the current editor. Note that if the PopupCalendarOwnerID property is set, the popup calendar's settings are taken from the ASPxDateEdit.CalendarProperties property of the specified date editor. If the time edit is visible (the DateEditTimeSectionProperties.Visible is set to true) its settings are taken from the ASPxDateEdit.TimeSectionProperties property of the specified date editor.

NOTE

The PopupCalendarOwnerID property should not refer to a date editor whose PopupCalendarOwnerID property is also set.

Examples

This example shows how to minimize the amount of rendered HTML code by using the same calendar control for every date editor within the ASPxGridView.

using System;
using DevExpress.Web.Data;
using DevExpress.Web;

public partial class _Default : System.Web.UI.Page {

    protected override void OnLoad(EventArgs e) {
        base.OnLoad(e);
        if(!IsPostBack)
            Grid.StartEdit(0);
    }

    protected void Grid_RowUpdating(object sender, ASPxDataUpdatingEventArgs e) {
        e.Cancel = true;
    }

    protected void Grid_CellEditorInitialize(object sender, DevExpress.Web.ASPxGridViewEditorEventArgs e) {
        SetupCalendarOwner(e.Editor as ASPxDateEdit);
    }

    protected void Grid_AutoFilterCellEditorInitialize(object sender, DevExpress.Web.ASPxGridViewEditorEventArgs e) {
        SetupCalendarOwner(e.Editor as ASPxDateEdit);
    }

    void SetupCalendarOwner(ASPxDateEdit editor) {
        if(editor == null) return;
        editor.PopupCalendarOwnerID = "__ReferenceDateEdit";
    }

}