aspnet-devexpress-dot-web-dot-gridviewcommandcolumn.md
Specifies the number of rows that a command column spans.
Namespace : DevExpress.Web
Assembly : DevExpress.Web.v25.2.dll
NuGet Package : DevExpress.Web
[DefaultValue(1)]
public int CellRowSpan { get; set; }
<DefaultValue(1)>
Public Property CellRowSpan As Integer
| Type | Default | Description |
|---|---|---|
| Int32 | 1 |
The number of rows that the command column spans.
|
Use the CellRowSpan property to specify the number of rows that a command column spans.
Example 1
The maximum depth of a columns hierarchy is equal to two (for the command column). By default, the Photo column occupies one row, and the deepest child column (Price) occupies remaining free space, i.e., two rows.
<dx:ASPxGridView ID="Grid" >
<Columns>
<dx:GridViewCommandColumn ShowDeleteButton="True" ShowEditButton="True" VisibleIndex="0" CellRowSpan="2" />
<dx:GridViewDataImageColumn FieldName="PhotoUrl" Caption="Photo" />
<dx:GridViewDataColumn FieldName="Address" >
<Columns>
<dx:GridViewDataColumn FieldName="Features">
<Columns>
<dx:GridViewDataColumn FieldName="Beds" />
<dx:GridViewDataColumn FieldName="Baths" />
<dx:GridViewDataColumn FieldName="HouseSize" />
<dx:GridViewDataColumn FieldName="YearBuilt" />
</Columns>
</dx:GridViewDataColumn>
<dx:GridViewDataSpinEditColumn FieldName="Price" />
</Columns>
</dx:GridViewDataColumn>
</Columns>
</dx:ASPxGridView>
Example 2
In this example, the CellRowSpan property is set to 2 for Photo column, therefore it occupies two rows.
<dx:ASPxGridView ID="Grid" >
<Columns>
<dx:GridViewCommandColumn ShowDeleteButton="True" ShowEditButton="True" VisibleIndex="0" />
<dx:GridViewDataImageColumn FieldName="PhotoUrl" Caption="Photo" CellRowSpan="2" />
<dx:GridViewDataColumn FieldName="Address" >
<Columns>
<dx:GridViewDataColumn FieldName="Features">
<Columns>
<dx:GridViewDataColumn FieldName="Beds" />
<dx:GridViewDataColumn FieldName="Baths" />
<dx:GridViewDataColumn FieldName="HouseSize" />
<dx:GridViewDataColumn FieldName="YearBuilt" />
</Columns>
</dx:GridViewDataColumn>
<dx:GridViewDataSpinEditColumn FieldName="Price" />
</Columns>
</dx:GridViewDataColumn>
</Columns>
</dx:ASPxGridView>
ASPxGridView - How to create header and data cell bands
ASPxGridView - Data Cell Bands
ASPxGridView - Data Cell Bands
See Also