Skip to main content
Tab

ASPxDropDownEdit.DropDownCloseButton Property

Gets the settings of the Close command buttons in dropdown editors.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v23.2.dll

NuGet Package: DevExpress.Web

Declaration

public virtual DropDownEditCommandButton DropDownCloseButton { get; }

Property Value

Type Description
DropDownEditCommandButton

n object that contains button properties.

Remarks

Use the DropDownCloseButton property to access the settings which define the Close command button - a click on this button closes the dropdown.

You can handle the DropDownCommandButtonClick event to process the button click.

Command Buttons

Web Forms Example

Run Demo: Modal DropDowns (Web Forms)

<dx:ASPxDropDownEdit ClientInstanceName="ddeExtraServices" ID="ddeExtraServices" 
    runat="server" AutoPostBack="false">
    <DropDownApplyButton Visibility="Always"></DropDownApplyButton>
    <DropDownCloseButton Visibility="Always"></DropDownCloseButton>
    <ClientSideEvents DropDownCommandButtonClick="OnDropDownCommandButtonClick" />
    <%-- ... --%>
</dx:ASPxDropDownEdit>
function OnDropDownCommandButtonClick(s, e){
  if (e.commandName == 'Apply')
    ddeExtraServices.HideDropDown();
  if (e.commandName == 'Close'){
    ddeExtraServices.SetText(tempText);
    ddeExtraServices.HideDropDown();
  }
}

MVC Example

Run Demo: Modal DropDowns (MVC)

...
group.Items.Add(i => {
    i.Caption="Extra Services";
    i.HelpText="Additional fee charged";
    i.NestedExtension().DropDownEdit(s => {
        s.Name = "ddeExtraServices";
        s.Properties.DropDownApplyButton.Visibility = DropDownElementVisibility.Always;
        s.Properties.DropDownCloseButton.Visibility = DropDownElementVisibility.Always;
        ...
        s.Properties.ClientSideEvents.DropDownCommandButtonClick = "onDropDownCommandButtonClick";
    });
});
function onDropDownCommandButtonClick(s, e) {
    if (e.commandName == "Apply")
        s.HideDropDown();
    if (e.commandName == "Close") {
        s.SetText(tempText);
        s.HideDropDown();
    }
}
See Also