aspnet-devexpress-dot-web-dot-cardviewtablelayoutsettings.md
Gets or sets the number of columns that a page displays in table mode.
Namespace : DevExpress.Web
Assembly : DevExpress.Web.v25.2.dll
NuGet Package : DevExpress.Web
[DefaultValue(3)]
public int ColumnCount { get; set; }
<DefaultValue(3)>
Public Property ColumnCount As Integer
| Type | Default | Description |
|---|---|---|
| Int32 | 3 |
An Int32 value that specifies the number of columns displayed within a page.
|
You can access this nested property as listed below:
| Library | Object Type | Path to ColumnCount |
|---|---|---|
| ASP.NET MVC Extensions | CardViewPagerState |
.SettingsTableLayout .ColumnCount
| | ASP.NET Web Forms Controls | ASPxCardViewPagerSettings |
.SettingsTableLayout .ColumnCount
|
Use the ColumnCount property to specify the number of columns that a page displays when the ASPxCardViewSettings.LayoutMode property is set to Table. The number of rows can be specified via the CardViewTableLayoutSettings.RowsPerPage property.
If the ASPxCardView displays data in a flow layout (the ASPxCardViewSettings.LayoutMode property is set to Flow ), the number of items on a page can be specified via the CardViewFlowLayoutSettings.ItemsPerPage property.
To see data export in action, refer to the following online demo: Exporting to PDF, XLS, XLSX, RTF.
public partial class Exporting_Exporting : System.Web.UI.Page {
protected void btnPdfExport_Click(object sender, EventArgs e) {
cardViewExport.WritePdfToResponse();
}
protected void btnXlsExport_Click(object sender, EventArgs e) {
cardViewExport.WriteXlsToResponse(new XlsExportOptionsEx() { ExportType = ExportType.DataAware });
}
protected void btnXlsxExport_Click(object sender, EventArgs e) {
cardViewExport.WriteXlsxToResponse(new XlsxExportOptionsEx() { ExportType = ExportType.DataAware });
}
protected void btnRtfExport_Click(object sender, EventArgs e) {
cardViewExport.WriteRtfToResponse();
}
}
<dx:ASPxCardView ID="cardView" runat="server" DataSourceID="ProductsDataSource" KeyFieldName="ProductID" AutoGenerateColumns="False">
<Columns>
...
</Columns>
<CardLayoutProperties>
...
</CardLayoutProperties>
<SettingsPager>
<SettingsTableLayout RowsPerPage="2" ColumnCount="2" />
</SettingsPager>
<Styles>
<Card Height="1" />
</Styles>
</dx:ASPxCardView>
<dx:ASPxCardViewExporter ID="cardViewExport" runat="server" CardViewID="cardView" CardWidth="300" />
See Also
CardViewTableLayoutSettings Class