Back to Devexpress

ASPxGridView.VisibleColumns Property

aspnet-devexpress-dot-web-dot-aspxgridview-adc371e5.md

latest3.9 KB
Original Source

ASPxGridView.VisibleColumns Property

Gets a collection of visible columns within the ASPxGridView.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public ReadOnlyGridColumnCollection<GridViewColumn> VisibleColumns { get; }
vb
Public ReadOnly Property VisibleColumns As ReadOnlyGridColumnCollection(Of GridViewColumn)

Property Value

TypeDescription
ReadOnlyGridColumnCollection<GridViewColumn>

A collection of visible columns in ASPxGridView.

|

Remarks

The VisibleColumns collection contains the columns with the Visible property set to true. To access the collection that contains all the columns owned by the ASPxGridView, use the ASPxGridView.AllColumns property.

The following code snippets (auto-collected from DevExpress Examples) contain references to the VisibleColumns property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

asp-net-mvc-grid-create-report-based-on-grid-layout/CS/E4755/Models/MVCxGridViewState.cs#L11

csharp
public MVCxGridViewState(MVCxGridView gridView) {
    Columns = new GridViewDataColumnStateCollection(gridView.VisibleColumns);
    GroupedColumns = new GridViewDataColumnStateCollection(gridView.GetGroupedColumns());

asp-net-web-forms-grid-create-report-based-on-grid-layout/CS/WebApplication1/ReportHelper.cs#L205

csharp
List<GridViewDataColumn> columns = new List<GridViewDataColumn>();
foreach(GridViewColumn column in aspxGridView1.VisibleColumns) {
    if(column is GridViewDataColumn)

asp-net-mvc-grid-create-report-based-on-grid-layout/VB/E4755/Models/MVCxGridViewState.vb#L68

vb
Public Sub New(ByVal gridView As MVCxGridView)
    Columns = New GridViewDataColumnStateCollection(gridView.VisibleColumns)
    GroupedColumns = New GridViewDataColumnStateCollection(gridView.GetGroupedColumns())

asp-net-web-forms-grid-create-report-based-on-grid-layout/VB/WebApplication1/ReportHelper.vb#L215

vb
Dim columns As New List(Of GridViewDataColumn)()
For Each column As GridViewColumn In aspxGridView1.VisibleColumns
    If TypeOf column Is GridViewDataColumn Then

See Also

Columns

Grid View

ASPxGridView Class

ASPxGridView Members

DevExpress.Web Namespace