Show theme settings Shopping cart Download trialFree Trial
Change Theme Settings
Change Theme Settings
Themes
 
Show All Themes
v
...v

Caption

Properties.Caption = "Text Box"
*
v
Properties.Caption = "Combo Box"
Properties.CaptionSettings.RequiredMarkDisplayMode = EditorRequiredMarkMode.Auto
Properties.CaptionSettings.RequiredMark = "*"
Properties.CaptionSettings.Position = EditorCaptionPosition.Top
Properties.ValidationSettings.RequiredField.IsRequired = true
Properties.ValidationSettings.Display = Display.Dynamic
(optional)
Properties.Caption = "Memo"
Properties.CaptionSettings.Position = EditorCaptionPosition.Top
Properties.CaptionSettings.RequiredMarkDisplayMode = EditorRequiredMarkMode.Optional
Properties.CaptionSettings.OptionalMark = " (optional)"
Properties.Caption = "Radio Button List"
Properties.CaptionSettings.VerticalAlign = EditorCaptionVerticalAlign.Middle


DevExpress Data Editors allow you to specify an editor's caption, which can be positioned and aligned relative to an editor. To customize the caption settings, you can use the following properties.

  • Caption - specifies the caption text.
  • Position - specifies the position of a caption related to the editor.
  • HorizontalAlign, VerticalAlign - specify the horizontal and vertical alignment of a caption.
  • ShowColon - specifies whether the colon sign is displayed after caption text.
  • RequiredMark - specifies the text displayed after a caption when the editor value is required.
  • OptionalMark - specifies the text displayed after a caption when the editor value is optional.
  • RequiredMarkDisplayMode - specifies which mark should be displayed after a caption. This property can be set to the following values.
    • Optional. The optional mark is displayed after a caption.
    • Required. The Required mark is displayed after a caption.
    • Hidden. Neither the optional mark nor the required mark is displayed after a caption.
    • Auto. If the IsRequired property is set to true, the required mark is displayed after a caption.

This demo illustrates how a DevExpress Data Editor's caption can be customized for editors of different types.

Collapse/Expand
Local Copy of this Demo
To inspect the source code for this demo on your machine, you must first install our components via the DevExpress Component Installer.
You can open a local copy of this online demo directly from this webpage (if using v20.2.8, 21.1.4 or higher).
Open CS Solution
The source code files for this demo are installed (by default) in the following directory:
\Users\Public\Documents\DevExpress Demos XX.X\Components\ASP.NET\CS\MVCxDataEditorsDemos