aspnetmvc-devexpress-dot-web-dot-mvc-dot-cardviewsettings-105eaf68.md
Enables you to change card layout properties.
Namespace : DevExpress.Web.Mvc
Assembly : DevExpress.Web.Mvc5.v25.2.dll
NuGet Package : DevExpress.Web.Mvc5
public ASPxCardViewCardLayoutCreatedEventHandler CardLayoutCreated { get; set; }
Public Property CardLayoutCreated As ASPxCardViewCardLayoutCreatedEventHandler
| Type | Description |
|---|---|
| ASPxCardViewCardLayoutCreatedEventHandler |
An ASPxCardViewCardLayoutCreatedEventHandler delegate method allowing you to implement custom processing.
|
var cardView = Html.DevExpress().CardView(settings =>
{
settings.Name = "CardView";
settings.CallbackRouteValues = new { Controller = "Home", Action = "CardViewPartial" };
settings.KeyFieldName = "ID";
...
settings.CardLayoutCreated = (s, e) =>
{
var cv = (MVCxCardView)s;
if (Convert.ToInt32(cv.GetCardValues(e.VisibleIndex, "ID")) == 2)
{
e.Properties.ForEach((item) =>
{
var cardLayoutItem = item as MVCxCardViewColumnLayoutItem;
if (cardLayoutItem != null)
if (cardLayoutItem.ColumnName == "Test")
cardLayoutItem.Visible = false;
});
}
};
});
See Also