Skip to main content
Tab

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.v23.2.dll

NuGet Package: DevExpress.Web

Declaration

[DefaultValue("")]
public string PopupCalendarOwnerID { get; set; }

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.

Example

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.

<dx:ASPxGridView runat="server" ID="Grid" AutoGenerateColumns="False" DataSourceID="AccessDataSource1" 
                 KeyFieldName="OrderID" OnAutoFilterCellEditorInitialize="Grid_AutoFilterCellEditorInitialize" OnCellEditorInitialize="Grid_CellEditorInitialize" OnRowUpdating="Grid_RowUpdating">
    <Columns>
        <dx:GridViewCommandColumn ShowEditButton="True" ShowClearFilterButton="True"/>
        <dx:GridViewDataTextColumn FieldName="OrderID" ReadOnly="True" >
            <EditFormSettings Visible="False" />
        </dx:GridViewDataTextColumn>
        <dx:GridViewDataDateColumn FieldName="OrderDate" />
        <dx:GridViewDataDateColumn FieldName="RequiredDate" />
        <dx:GridViewDataDateColumn FieldName="ShippedDate" />
    </Columns>
    <Settings ShowFilterRow="True" />
</dx:ASPxGridView>

<dx:ASPxDateEdit runat="server" ID="__ReferenceDateEdit" ClientVisible="false">
    <CalendarProperties>
        <Style BackColor="LightYellow" />
    </CalendarProperties>
</dx:ASPxDateEdit>
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";
}
See Also