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

GridViewColumn.CellStyle Property

Gets the style settings used to paint column cells.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v18.2.dll

Declaration

public virtual GridViewCellStyle CellStyle { get; }

Property Value

Type Description
GridViewCellStyle

A GridViewCellStyle object that contains the style settings used to paint column cells.

Remarks

Use the CellStyle property to specify the appearance of cells within an individual column. These style settings override the style settings common to all cells within a Grid View (GridViewStyles.Cell).

Limitations

  • Setting the Wrap property to false has no effect when the ColGroup tag is used in IE (column resizing).

     

    Example: Apply to all columns.

    <Templates>
                <DataItem>
                    <span style="white-space:nowrap"><%# Container.Text %></span>
                </DataItem>
    </Templates>
    

     

    Example: Apply to a single column.

    <dxwgv:GridViewDataTextColumn FieldName="CustomerName" VisibleIndex="2">
        <DataItemTemplate>
            <span style="white-space:nowrap"><%# Container.Text %></span>
        </DataItemTemplate>
    </dxwgv:GridViewDataTextColumn>
    
  • All settings set to the CellStyle property are overridden by the conditional formatting styles. However, all styles specified in the CellStyle.CssClass property are merged with the conditional formatting styles. To preserve the previously added cell styles, use the CssClass property as shown below.

    
    <CellStyle VerticalAlign="Top" CssClass="cellStyle"></CellStyle>
    
    
    .cellStyle {
        vertical-align: top !important;
    }
    
See Also