dashboard-devexpress-dot-dashboardcommon-d9b048df.md
An XRTextBox control that displays a TextBox dashboard item in the exported document.
Namespace : DevExpress.DashboardCommon
Assembly : DevExpress.Dashboard.v25.2.Core.dll
NuGet Package : DevExpress.Dashboard.Core
public class XRTextBox :
XRRichText
Public Class XRTextBox
Inherits XRRichText
XRTextBox is a printable control that corresponds to a TextBox item. Call the e.GetPrintableControls/e.GetPrintableControl method to get the XRTextBox control when you handle one of the following events:
The following code snippet illustrates how to get XRTextBox and customize the TextBox dashboard item:
using DevExpress.DashboardCommon;
using DevExpress.XtraReports.UI;
using System.Collections.Generic;
using System.Windows.Forms;
//...
private void DashboardDesigner1_CustomExport_1(object sender, CustomExportEventArgs e){
foreach (KeyValuePair<string, XRControl> xrControl in e.GetPrintableControls()){
XRTextBox xrTextBox = xrControl.Value as XRTextBox;
if (xrTextBox != null){
xrTextBox.CalculateDocumentVariable += OnCalculateDocumentVariable;
}
}
}
private void OnCalculateDocumentVariable(object sender, DevExpress.XtraRichEdit.CalculateDocumentVariableEventArgs e){
if(e.VariableName=="DataItem0")
e.Value += " (Custom text for Exporter)";
}
Imports DevExpress.DashboardCommon
Imports DevExpress.XtraReports.UI
Imports System.Collections.Generic
Imports System.Windows.Forms
'...
Private Sub DashboardDesigner1_CustomExport_1(ByVal sender As Object, ByVal e As CustomExportEventArgs)
For Each xrControl As KeyValuePair(Of String, XRControl) In e.GetPrintableControls()
Dim xrTextBox As XRTextBox = TryCast(xrControl.Value, XRTextBox)
If xrTextBox IsNot Nothing Then
AddHandler xrTextBox.CalculateDocumentVariable, AddressOf OnCalculateDocumentVariable
End If
Next xrControl
End Sub
Private Sub OnCalculateDocumentVariable(ByVal sender As Object, ByVal e As DevExpress.XtraRichEdit.CalculateDocumentVariableEventArgs)
If e.VariableName="DataItem0" Then
e.Value &= " (Custom text for Exporter)"
End If
End Sub
Object MarshalByRefObject Component XRControl XRFieldEmbeddableControl XRRichTextBase XRRichText XRTextBox
See Also