aspnet-devexpress-dot-web-18bc3523.md
A server ASPxCardView control.
Namespace : DevExpress.Web
Assembly : DevExpress.Web.v25.2.dll
NuGet Package : DevExpress.Web
public class ASPxCardView :
ASPxGridBase
Public Class ASPxCardView
Inherits ASPxGridBase
The following members return ASPxCardView objects:
The ASPxCardView is a data bound control designed to edit tabular information, representing it in cards.
The ASPxCardView control is available on the DX.25.2: Data & Analytics toolbox tab in the Microsoft Visual Studio IDE.
Drag the control onto a form and customize the control’s settings, or paste the control’s markup in the page’s source code.
<dx:ASPxCardView ID="CardView" runat="server" DataSourceID="CustomersDataSource">
<Columns>
<dx:CardViewColumn FieldName="ContactName" />
<dx:CardViewColumn FieldName="CompanyName" />
<dx:CardViewColumn FieldName="Address" />
<dx:CardViewColumn FieldName="City" />
<dx:CardViewColumn FieldName="PostalCode" />
<dx:CardViewColumn FieldName="Country" />
<dx:CardViewColumn FieldName="Phone" />
</Columns>
</dx:ASPxCardView>
<ef:EntityDataSource runat="server" ID="CustomersDataSource" ContextTypeName="DevExpress.Web.Demos.NorthwindContext" EntitySetName="Customers" />
using DevExpress.Web;
...
protected void Page_Load(object sender, EventArgs e)
{
ASPxCardView cardView = new ASPxCardView();
cardView.ID = "cardView";
Page.Form.Controls.Add(cardView);
cardView.DataSourceID = "CustomersDataSource";
cardView.Columns.AddRange(new CardViewColumn[] {
new CardViewColumn {FieldName = "ContactName", VisibleIndex = 0},
new CardViewColumn {FieldName = "CompanyName", VisibleIndex = 1},
new CardViewColumn {FieldName = "Address", VisibleIndex = 2},
new CardViewColumn {FieldName = "City", VisibleIndex = 3},
new CardViewColumn {FieldName = "PostalCode", VisibleIndex = 4},
new CardViewColumn {FieldName = "Country", VisibleIndex = 5},
new CardViewColumn {FieldName = "Phone", VisibleIndex = 6},
});
cardView.DataBind();
}
Imports DevExpress.Web
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
Dim cardView As ASPxCardView = New ASPxCardView()
cardView.ID = "cardView"
Page.Form.Controls.Add(cardView)
cardView.DataSourceID = "CustomersDataSource"
cardView.Columns.AddRange(New CardViewColumn() {
New CardViewColumn With {
.FieldName = "ContactName",
.VisibleIndex = 0
},
New CardViewColumn With {
.FieldName = "CompanyName",
.VisibleIndex = 1
},
New CardViewColumn With {
.FieldName = "Address",
.VisibleIndex = 2
},
New CardViewColumn With {
.FieldName = "City",
.VisibleIndex = 3
},
New CardViewColumn With {
.FieldName = "PostalCode",
.VisibleIndex = 4
},
New CardViewColumn With {
.FieldName = "Country",
.VisibleIndex = 5
},
New CardViewColumn With {
.FieldName = "Phone",
.VisibleIndex = 6
}
})
cardView.DataBind()
End Sub
Note
DevExpress controls require that you register special modules, handlers, and options in the Web.config file. You can change this file or switch to the Design tab in the Microsoft Visual Studio IDE to automatically update the Web.config file. Note that this information is automatically registered if you use the DevExpress Template Gallery to create a project.
The ASPxCardView control stores its columns within the ASPxCardView.Columns collection. Data columns can be automatically created for each field in the data source when the ASPxCardView is rendered, or created manually. This is controlled by the ASPxCardView.AutoGenerateColumns property.
By default, this property is set to true. This forces the ASPxCardView to render each field from the data source as a data column. The order of columns is the same as the order of fields in the data source. To manually control which columns are to appear in the ASPxCardView , set the ASPxCardView.AutoGenerateColumns property to false. In this case, you should manually add data columns to the ASPxCardView.Columns collection.
The ASPxCardView control provides you with a comprehensive client-side functionality implemented using JavaScript code.
The client-side API is always available for this control.
Show 17 items
DevExpress.Data.IDataControllerSort
Show 11 items
Object Control WebControl ASPxWebControlBase ASPxWebControl ASPxDataWebControlBase ASPxDataWebControl ASPxGridBase ASPxCardView BootstrapCardView
See Also