Back to Devexpress

XRControl.XRControlStyles.OddStyle Property

xtrareports-devexpress-dot-xtrareports-dot-ui-dot-xrcontrol-dot-xrcontrolstyles-01580345.md

latest3.2 KB
Original Source

XRControl.XRControlStyles.OddStyle Property

Gets or sets the style applied to the control when it displays an odd record from the bound data source.

Namespace : DevExpress.XtraReports.UI

Assembly : DevExpress.XtraReports.v25.2.dll

NuGet Package : DevExpress.Reporting.Core

Declaration

csharp
[DefaultValue(null)]
public virtual XRControlStyle OddStyle { get; set; }
vb
<DefaultValue(Nothing)>
Public Overridable Property OddStyle As XRControlStyle

Property Value

TypeDefaultDescription
XRControlStylenull

The name of the style from the Styles collection.

|

Remarks

The odd style is the style applied to the control when it displays an odd record from the bound dataset. You can use the XtraReportBase.CurrentRowIndex property to define whether the row index.

csharp
if (CurrentRowIndex % 2 == 0) {  
    //Even  
}  
else {  
    //Odd  
}
vb
If CurrentRowIndex Mod 2 = 0 Then
    'Even  
Else
    'Odd  
End If

If the control consists of static rows, such as a static table with multiple rows, then even and odd styles do not apply.

You can find examples of even and odd styles in the following help sections:

See Also

XRControl.XRControlStyles Class

XRControl.XRControlStyles Members

DevExpress.XtraReports.UI Namespace