Back to Devexpress

GridViewStyles.FocusedRow Property

aspnet-devexpress-dot-web-dot-gridviewstyles-a08a4dc8.md

latest3.0 KB
Original Source

GridViewStyles.FocusedRow Property

Specifies the appearance of the focused data row.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public GridViewDataRowStyle FocusedRow { get; }
vb
Public ReadOnly Property FocusedRow As GridViewDataRowStyle

Property Value

TypeDescription
GridViewDataRowStyle

Style settings that specify the focused row appearance.

|

Remarks

Set the AllowFocusedRow property to true to enable row focus.

When row focus is disabled, the style settings of the focused row are not in effect. To identify the row being edited, use the EditingRowVisibleIndex property.

When cell merge is enabled, ASPxGridView doesn’t support row focus.

The FocusedRow property allows you to specify the appearance of the focused row in markup and in a CSS class.

Markup Example

Web Forms

aspx
<dx:ASPxGridView ID="ASPxGridView1" >  
    <%--...--%>
    <Styles>  
        <FocusedRow BackColor="Brown" ForeColor="Yellow" >
        </FocusedRow>  
    </Styles>  
</dx:ASPxGridView>

MVC

csharp
settings.Styles.FocusedRow.BackColor = System.Drawing.Color.Brown; 
settings.Styles.FocusedRow.ForeColor = System.Drawing.Color.Yellow;

CSS Example

Web Forms

css
#ASPxGridView1 .focusedRowStyle td{  
    background-color: Brown;  
}
aspx
<dx:ASPxGridView ID="ASPxGridView1" >  
    <%--...--%>
    <Styles>  
        <FocusedRow CssClass="focusedRowStyle" />
    </Styles>  
</dx:ASPxGridView>

MVC

cshtml
<style type="text/css">
    .focusedRowStyle {
        background-color: Brown;
    }
</style>
csharp
settings.Styles.FocusedRow.CssClass = "focusedRowStyle";

Online Demo

Run Demo: ASPxGridView - Focused Row

Run Demo: MVCxGridView - FocusedRow

See Also

GridViewStyles Class

GridViewStyles Members

DevExpress.Web Namespace