ASPxClientRibbonItem.SetValue(value) Method

Sets the item value.

Declaration

SetValue(
    value: any
): void

Parameters

Name Type Description
value any

An that specifies the item value.

Remarks

Use the SetValue method to specify the item value. To get the value, use the ASPxClientRibbonItem.GetValue method.

The format of the value parameter depends on the processed ribbon item type. The table below lists the ribbon items with the value formats.

Editor Name

Server-Side Class

Value Format

Example

Button

RibbonButtonItem

-

-

Check Box

RibbonCheckBoxItem

true to check the item; otherwise false

ribbonItem.SetValue(true);

Color Button

RibbonColorButtonItem

The method supports the following color value formats.

  • HTML color name;
  • Longhand hexadecimal notation;
  • Shorthand hexadecimal notation;
  • RGB format;

ribbonItem.SetValue(‘red’);

ribbonItem.SetValue(‘#FFFF00’);

ribbonItem.SetValue(‘#FF0’);

ribbonItem.SetValue(‘rgb(255,255,0)’);

Combo Box

RibbonComboBoxItem

A string that is the item text value

ribbonItem.SetValue(‘Arial’);

Date Edit

RibbonDateEditItem

A date object specifying the item value

ribbonItem.SetValue(new Date (‘03/02/2011’));

Drop-Down Button

RibbonDropDownButtonItem

-

-

Drop-Down Toggle Button

RibbonDropDownToggleButtonItem

true to check the item; otherwise false

ribbonItem.SetValue(true);

Drop-Down Gallery

RibbonGalleryDropDownItem

Depends on the RibbonGalleryProperties.ValueType property

ribbonItem.SetValue(14);

Gallery Bar

RibbonGalleryBarItem

Depends on the RibbonGalleryBarItem.ValueType property

ribbonItem.SetValue(‘highlight’);

Option Button

RibbonOptionButtonItem

true to check the item; otherwise false

ribbonItem.SetValue(true);

Spin Edit

RibbonSpinEditItem

A number specifying the item value

ribbonItem.SetValue(14);

Template Item

RibbonTemplateItem

-

-

Text Box

RibbonTextBoxItem

A string specifying the item value

ribbonItem.SetValue(‘Ann Devon’);

Toggle Button

RibbonToggleButtonItem

true to check the item; otherwise false

ribbonItem.SetValue(true);

See Also