GridViewColumn.Columns Property
In This Article
Provides access to a collection of columns that the current column combines.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v24.2.dll
#Declaration
public GridViewColumnCollection Columns { get; }
#Property Value
Type | Description |
---|---|
Grid |
An Grid |
#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