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

ASPxClientEditBase.SetValue(value) Method

Changes the editor’s value.

Declaration

SetValue(
    value: any
): void

Parameters

Name Type Description
value any

An object representing the data to be assigned to the editor’s edit value.

Remarks

The SetValue method can be used to assign a new value to an editor on the client side.

Note that the editor’s edited value can be represented by different data entities depending upon the editor type. So, for a text editor, the parameter’s value represents the text to be assigned to the editor. However, for a check editor, it equals either ASPxCheckBox.ValueChecked or ASPxCheckBox.ValueUnchecked, representing the editor’s current state. The value to be assigned to a list box editor is specified by the ListEditItem.Value property that indicates the list item to be selected, etc.

NOTE

For ASPxComboBox and ASPxListBox controls only:

If a callback mode is enabled (the ASPxAutoCompleteBoxBase.EnableCallbackMode/ASPxListBox.EnableCallbackMode property is set to true) the SetValue method cannot be used to select items that are not currently displayed within the editor’s window. To learn more, see the On-Demand Item Loading (Callback Mode) topic.

Examples

In this example, clicking the ASPxHyperLink sets the ASPxTextBox value to the hyperlink’s text using the client ASPxClientEditBase.SetValue method.

function OnHyperLinkClick(s, e) {
    var sampleText = s.GetText();
    tbText.SetValue(sampleText);
    ...
}
See Also