ASPxDropDownEdit.DropDownCloseButton Property
Gets the settings of the Close command buttons in dropdown editors.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v24.1.dll
NuGet Package: DevExpress.Web
Declaration
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.
Web Forms Example
<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
...
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