Back to Devexpress

GridViewSettings Class

aspnetmvc-devexpress-dot-web-dot-mvc-8d6b517c.md

latest2.6 KB
Original Source

GridViewSettings Class

Contains the GridView extension settings.

Namespace : DevExpress.Web.Mvc

Assembly : DevExpress.Web.Mvc5.v25.2.dll

NuGet Package : DevExpress.Web.Mvc5

Declaration

csharp
public class GridViewSettings :
    GridSettingsBase
vb
Public Class GridViewSettings
    Inherits GridSettingsBase

Remarks

To declare the GridView in a View, invoke the ExtensionsFactory.GridView helper method. This method returns the GridView extension that is implemented by the GridViewExtension class.

To configure the GridView extension, pass the GridViewSettings object to the ExtensionsFactory.GridView helper method as a parameter. The GridViewSettings object contains all the GridView extension settings.

Refer to the GridView Overview topic to learn how to add the GridView extension to your project.

Concept

Gridview Overview

Example

razor
@Html.DevExpress().GridView(
    settings =>
    {
        settings.Name = "myGridView";
        settings.CallbackRouteValues = new { Controller = "Home", Action = "GridViewPart" };
        settings.Width = 450;

        settings.Columns.Add("ContactName");
        settings.Columns.Add("CompanyName");
        settings.Columns.Add("City").SortOrder = DevExpress.Data.ColumnSortOrder.Ascending;
        settings.Columns.Add("Region");
        settings.Columns.Add("Country");
}).Bind(Model).GetHtml()

Inheritance

Object SettingsBase GridSettingsBase GridViewSettings GridViewSettings<RowType>

See Also

GridViewSettings Members

Grid View

GridViewExtension

DevExpress.Web.Mvc Namespace