MVCxGridView 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.Mvc.v17.2.dll
Declaration
public class MVCxGridView :
ASPxGridView,
IGridAdapterOwner,
IWebDataOwner,
IViewContext,
IFilterControlOwner
Related API Members
The following members accept/return MVCxGridView objects:
Remarks
Note
To add the GridView extension to the View, refer to the GridView Overview topic.
The object of MVCxGridView type represents the configured instance of DevExpress ASP.NET MVC GridView extension. The MVCxGridView 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 MVCxGridView object within the delegate method that processes the SettingsBase.PreRender server event.
View code:
@Html.DevExpress().GridView(
settings =>
{
settings.Name = "grid";
// ...
// Expand the first detail row.
settings.PreRender = (sender, e) => {
((MVCxGridView)sender).DetailRows.ExpandRow(0);
};
}).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).
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the MVCxGridView class.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.