Back to Devexpress

GridColumnCollection.ForEach(Action<GridColumn>) Method

windowsforms-devexpress-dot-xtragrid-dot-columns-dot-gridcolumncollection-dot-foreach-x28-system-dot-action-devexpress-dot-xtragrid-dot-columns-dot-gridcolumn-x29.md

latest1.8 KB
Original Source

GridColumnCollection.ForEach(Action<GridColumn>) Method

Executes the specified action on each element in the collection.

Namespace : DevExpress.XtraGrid.Columns

Assembly : DevExpress.XtraGrid.v25.2.dll

NuGet Packages : DevExpress.Win.Grid, DevExpress.Win.Navigation

Declaration

csharp
public void ForEach(
    Action<GridColumn> action
)
vb
Public Sub ForEach(
    action As Action(Of GridColumn)
)

Parameters

NameTypeDescription
actionAction<GridColumn>

The delegate to execute on each element in the collection.

|

Remarks

The code below converts the captions of all column headers to uppercase.

csharp
gridView1.Columns.ForEach(column => column.Caption = column.Caption.ToUpper());
vb
gridView1.Columns.ForEach(Sub(column) column.Caption = column.Caption.ToUpper())

See Also

GridColumnCollection Class

GridColumnCollection Members

DevExpress.XtraGrid.Columns Namespace