Skip to main content

XRControl.Name Property

Gets or sets a name of the control.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v23.2.dll

NuGet Package: DevExpress.Reporting.Core

Declaration

[Browsable(false)]
[DefaultValue("")]
public string Name { get; set; }

Property Value

Type Default Description
String String.Empty

A String that is the control’s name. It should start with a letter or underscore (_).

Remarks

The Name property identifies a control in the collection. You can use the parent control’s FindControl method to find a control by its name in the collection of child controls.

The name of a report control should be a valid C# identifier and meet the following requirements:

  • it is not a reserved .NET word, library name or XtraReport class property name (DataSource, Version, etc.)
  • it starts with a letter or an underscore (_)
  • it does not contain spaces
  • it is unique in the collection.

When you use the Report Designer to add a control, the name is generated automatically. You do not have to specify a name at runtime if you do not intend to use it in your code.

The Report Designer validates the name entered in the Properties window and displays an error message if validation fails. Incorrect names are replaced with automatically generated values at runtime.

The following code snippets (auto-collected from DevExpress Examples) contain references to the Name property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also