Skip to main content
A newer version of this page is available. .

XRControl.BorderWidth Property

Specifies the width of cell borders in pixels, as a floating point value.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v22.2.dll

NuGet Package: DevExpress.Reporting.Core

Declaration

[SRCategory(ReportStringId.CatAppearance)]
public virtual float BorderWidth { get; set; }

Property Value

Type Description
Single

A Single value.

Example

This code snippet assigns custom appearance settings to report labels. The ResetStyle method clears the appearance settings of the control. This makes the control use the values from the parent control’s settings.

View Example: Reporting for WinForms - Appearance Settings, Styles, Style Priority

#region #Usings
using System.Drawing;
using System.Drawing.Printing;
using DevExpress.XtraPrinting;
using DevExpress.XtraReports.UI;
// ...
#endregion #Usings

namespace ResetControlStyle {
    public partial class XtraReport1 : DevExpress.XtraReports.UI.XtraReport {
        public XtraReport1() {
            InitializeComponent();
        }

#region #Code
private void xrLabel2_BeforePrint(object sender, PrintEventArgs e) {
    SetCustomStyle((XRLabel)sender);
}

private void xrLabel3_BeforePrint(object sender, PrintEventArgs e) {
    SetCustomStyle((XRLabel)sender);
    ResetStyle((XRLabel)sender);
}

// Assign custom appearance settings to a control.
private void SetCustomStyle(XRLabel label) {
    label.BackColor = Color.Gray;
    label.BorderColor = Color.DarkGray;
    label.Borders = BorderSide.All;
    label.BorderWidth = 0.5f;

    label.Font = new Font(label.Parent.Font, FontStyle.Bold);
    label.ForeColor = Color.White;
    label.TextAlignment = TextAlignment.MiddleRight;
}

// Restore the appearance settings to their default values.
private void ResetStyle(XRLabel label) {
    label.ResetBackColor();
    label.ResetBorderColor();
    label.ResetBorders();
    label.ResetBorderWidth();
    label.ResetFont();
    label.ResetForeColor();
    label.ResetPadding();
    label.ResetTextAlignment();
}
#endregion #Code
    }
}

The following code snippets (auto-collected from DevExpress Examples) contain references to the BorderWidth 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