ASPxClientDropDownCommandEventArgs.commandName Property
Gets the name of the processed command in the DropDownCommandButtonClick event.
Declaration
commandName: string
Property Value
Type | Description |
---|---|
string | A string value that represents the processed command’s name. |
Remarks
The commandName
property can return Apply
or Close
value.
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