GridViewColumn.Columns Property
Provides access to a collection of columns that the current column combines.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v24.1.dll
NuGet Package: DevExpress.Web
Declaration
Property Value
Type | Description |
---|---|
GridViewColumnCollection | An GridViewColumnCollection object that is a collection of columns grouped by the current column. |
Remarks
The Columns property stores a collection of GridViewColumn objects. This allows you to create data cell bands. The obtained column collection provides methods that allow you to add new and remove existing columns. Individual columns can be accessed using indexed notation.
Concept
Example
In markup:
<dx:ASPxGridView ID="Grid" runat="server" ...>
<Columns>
<dx:GridViewDataColumn FieldName="Address">
<Columns>
<dx:GridViewDataColumn FieldName="Features">
<Columns>
<dx:GridViewDataColumn FieldName="Beds" />
...
</Columns>
</dx:GridViewDataColumn>
...
</Columns>
</dx:GridViewDataColumn>
</Columns>
</dx:ASPxGridView>
In code:
ASPxGridView grid1 = new ASPxGridView();
grid1.ID = "grid1";
Page.Form.Controls.Add(grid1);
...
GridViewDataColumn address = new GridViewDataColumn();
address.FieldName = "Address";
GridViewDataColumn features = new GridViewDataColumn();
features.FieldName = "Features";
GridViewDataColumn beds = new GridViewDataColumn();
beds.FieldName = "Beds";
address.Columns.Add(features);
features.Columns.Add(beds);
Online Example
ASPxGridView - How to create header and data cell bands
Online Demo
ASPxGridView - Data Cell Bands
Online Video
ASPxGridView - Data Cell Bands
See Also