GridView.FocusRectStyle Property
Gets or sets a value specifying how the focus rectangle is painted.
Namespace: DevExpress.XtraGrid.Views.Grid
Assembly: DevExpress.XtraGrid.v22.2.dll
NuGet Package: DevExpress.Win.Grid
Declaration
[DefaultValue(DrawFocusRectStyle.CellFocus)]
[DXCategory("Appearance")]
[XtraSerializableProperty]
public virtual DrawFocusRectStyle FocusRectStyle { get; set; }
Property Value
Type | Default | Description |
---|---|---|
DrawFocusRectStyle | CellFocus | A DrawFocusRectStyle enumerator value. |
Available values:
Name | Description |
---|---|
None | The focus rectangle is not painted. |
RowFocus | The focus rectangle is painted around the focused row, excluding the preview section (if it’s visible). |
CellFocus | The focus rectangle is painted around the focused cell. |
RowFullFocus | The focus rectangle is painted around the focused row, encompassing the preview section (if it’s visible). |
Example
This example shows how to paint the focused cell using the same appearance as the entire focused row:
// Make the grid read-only.
gridView1.OptionsBehavior.Editable = false;
// Prevent the focused cell from being highlighted.
gridView1.OptionsSelection.EnableAppearanceFocusedCell = false;
// Draw a dotted focus rectangle around the entire row.
gridView1.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus;