MVCxCardView Class
The object of this type represents a configured instance of the corresponding extension and is intended to be used mainly as a sender parameter when processing events on the server side.
Namespace: DevExpress.Web.Mvc
Assembly: DevExpress.Web.Mvc5.v24.1.dll
NuGet Package: DevExpress.Web.Mvc5
Declaration
Remarks
Note
To add the CardView extension to the View, refer to the Overview - CardView topic.
The object of MVCxCardView type represents the configured instance of DevExpress ASP.NET MVC CardView extension. The MVCxCardView object is intended to be used mainly as a sender parameter when processing events on the server side.
The code sample below illustrates how to use the MVCxCardView object within the delegate method that processes the SettingsBase.PreRender server event.
View code:
@Html.DevExpress().CardView(
settings =>
{
settings.Name = "cardView";
// ...
// Start editing of the first card.
settings.PreRender = (sender, e) => {
((MVCxCardView)sender).StartEdit(1);
};
}).Bind(Model).GetHtml()
Note
To properly follow the ASP.NET MVC pattern, it is recommended to respond to end-user actions on the client-side (see Client-Side API) or to use Ajax callbacks to the server and handle these callbacks using custom action methods (see Using Callbacks).