xtrareports-devexpress-dot-xtrareports-dot-ui-dot-xrcontrol-3a652f15.md
Deserializing a report layout from untrusted resources may create security issues. Serializable System.Object properties that contain custom type values are not (de)serialized automatically. Review the following help topic for information on how to (de)serialize custom type values: Reporting — Safe Deserialization.
Bindable. Gets or sets the object that contains data about this control.
Namespace : DevExpress.XtraReports.UI
Assembly : DevExpress.XtraReports.v25.2.dll
NuGet Package : DevExpress.Reporting.Core
[DefaultValue("")]
[SRCategory(ReportStringId.CatData)]
public virtual object Tag { get; set; }
<SRCategory(ReportStringId.CatData)>
<DefaultValue("")>
Public Overridable Property Tag As Object
| Type | Default | Description |
|---|---|---|
| Object | String.Empty |
An Object that contains data about the control.
|
Any type derived from the Object class can be assigned to this property.
A common use for the Tag property is to store data that is closely associated with this control.
Note
The Tag property is bindable, which means that it can be bound to a data field in a report’s data source. To learn more, see the Binding Report Controls to Data section.
The following code snippets (auto-collected from DevExpress Examples) contain references to the Tag 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.
reporting-winforms-custom-table-of-contents/CS/CustomTableOfContents/CategoriesReport.cs#L15
XRControl label = sender as XRControl;
label.Tag = String.Format("Link_{0}", GetCurrentColumnValue("CategoryID"));
}
reporting-winforms-drill-through/CS/MasterReport.cs#L14
private void xrLabel1_BeforePrint(object sender, PrintEventArgs e) {
((XRLabel)sender).Tag = GetCurrentRow();
}
reporting-winforms-custom-table-of-contents/VB/CustomTableOfContents/CategoriesReport.vb#L16
Dim label As XRControl = TryCast(sender, XRControl)
label.Tag = String.Format("Link_{0}", GetCurrentColumnValue("CategoryID"))
End Sub
reporting-winforms-drill-through/VB/MasterReport.vb#L16
Private Sub xrLabel1_BeforePrint(ByVal sender As Object, ByVal e As PrintEventArgs)
CType(sender, XRLabel).Tag = GetCurrentRow()
End Sub
See Also