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

GridViewStyles.FocusedRow Property

Gets the style settings used to paint the currently focused data row.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v20.2.dll

NuGet Package: DevExpress.Web

Declaration

public GridViewDataRowStyle FocusedRow { get; }

Property Value

Type Description
GridViewDataRowStyle

A GridViewDataRowStyle object that provides style settings used to paint the currently focused data row.

Remarks

To specify style settings used to paint data rows, use the GridViewStyles.Row property.

Note

The FocusedRow property is not in effect if cell merging is enabled.

Example

The example bellow illustrates how to paint the focused row in two ways:

  • use the FocusedRow property:

    Web Forms:

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

    MVC:

    settings.Styles.FocusedRow.BackColor = System.Drawing.Color.Brown; 
    settings.Styles.FocusedRow.ForeColor = System.Drawing.Color.Yellow;
    
  • use the CSS class:

    Web Forms:

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

    MVC:

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

Online Demo

See Also