jqGrid supports various rules for clientside validation. They are available through the EditClientSideValidators collection for each column. Since this is a collection, you can stack several validation rules at once - they will all apply to the edit field.

For details, please take a look at the ASPX tab.
@model MVCDemo.Models.EditValidationModel
@using Trirand.Web.Mvc
@using MVCDemo.Models

<!DOCTYPE html>
<html lang="en-us">
    <meta charset="utf-8">
    <title>jqGrid for ASP.NET MVC - Client-side validation</title>    
    <!-- jQuery runtime minified -->
    <script src="~/Scripts/jquery-3.2.1.min.js" type="text/javascript"></script>
    <!-- The jqGrid localization file we need, English in this case -->
    <script type="text/javascript" src="~/Scripts/trirand/i18n/grid.locale-en.js"></script>
    <!-- The jqGrid client-side javascript -->
    <script type="text/javascript" src="~/Scripts/trirand/jquery.jqGrid.min.js"></script>

    <!-- The jQuery UI theme that will be used by the grid. -->
    <link rel="stylesheet" type="text/css" href="http://code.jquery.com/ui/1.12.1/themes/redmond/jquery-ui.css" />
    <!-- The jQuery UI theme extension jqGrid needs -->    
    <link rel="stylesheet" type="text/css" href="~/Content/themes/ui.jqgrid.css" />
        @Html.Trirand().JQGrid(Model.ValidatedGrid, "JQGrid1")
    <br /><br />
    <script type="text/javascript">

        function validateCustomField(value, colname) {            
            if (value < 0 || value > 20)
                return [false, "Custom column: Please enter value between 0 and 20"];
                return [true, ""];
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MVCDemo.Models;
using Trirand.Web.Mvc;

namespace MVCDemo.Controllers.Grid
    public partial class GridController : Controller
        // This is the default action for the View. Use it to setup your grid Model.
        public ActionResult EditClientSideValidation()
            // Get the model (setup) of the grid defined in the /Models folder.
            var gridModel = new EditValidationModel();
            // This method sets common properties for the grid, different than the default in the Model

            // Pass the custmomized grid model to the View
            return View(gridModel);

        public void SetUpGrid_EditClientSideValidation(JQGrid grid)
            // Setting the DataUrl to an action (method) in the controller is required.
            // This action will return the data needed by the grid.
            // EditUrl will point to the editing action
            grid.DataUrl = Url.Action("EditClientSideValidation_DataRequested");
            grid.EditUrl = Url.Action("EditClientSideValidation_EditRow");

            var integerColumn = grid.Columns.Find(c => c.DataField == "Integer");
            integerColumn.EditClientSideValidators.Add(new RequiredValidator());
            integerColumn.EditClientSideValidators.Add(new MinValueValidator { MinValue = 10 });
            integerColumn.EditClientSideValidators.Add(new MaxValueValidator { MaxValue = 100 });

            var numberColumn = grid.Columns.Find(c => c.DataField == "Number");
            numberColumn.EditClientSideValidators.Add(new RequiredValidator());
            numberColumn.EditClientSideValidators.Add(new MinValueValidator { MinValue = 0.1 });
            numberColumn.EditClientSideValidators.Add(new MaxValueValidator { MaxValue = 100.1 });

            var emailColumn = grid.Columns.Find(c => c.DataField == "Email");
            emailColumn.EditClientSideValidators.Add(new RequiredValidator());
            emailColumn.EditClientSideValidators.Add(new EmailValidator());

            var linkColumn = grid.Columns.Find(c => c.DataField == "Link");
            linkColumn.EditClientSideValidators.Add(new RequiredValidator());
            linkColumn.EditClientSideValidators.Add(new UrlValidator());

            var customColumn = grid.Columns.Find(c => c.DataField == "Custom");
            customColumn.EditClientSideValidators.Add(new Trirand.Web.Mvc.CustomValidator { ValidationFunction = "validateCustomField" });

        // This method is called when the grid requests data. You can choose any method to call
        // by setting the JQGrid.DataUrl property
        public JsonResult EditClientSideValidation_DataRequested()
            // Get both the grid Model
            // The data model in our case is an autogenerated linq2sql database based on Northwind.
            var gridModel = new EditValidationModel();

            // return the result of the DataBind method, passing the datasource as a parameter
            // jqGrid for ASP.NET MVC automatically takes care of paging, sorting, filtering/searching, etc
            List<ClientValidatedEmployee> employees = GetClientValidatedEmployeeData();
            return gridModel.ValidatedGrid.DataBind(employees.AsQueryable());

        public void EditClientSideValidation_EditRow(ClientValidatedEmployee editedEmployee)
            // Get the grid and database (northwind) models
            var grid = new EditValidationModel().ValidatedGrid;
            var northWindModel = new NorthwindDataContext();

            // Get the edit data using the JQGrid GetEditData() method
            var editData = grid.GetEditData();

            // If we are in "Edit" mode
            if (grid.AjaxCallBackMode == AjaxCallBackMode.EditRow)
                // Get the data from and find the Order corresponding to the edited row
                List<ClientValidatedEmployee> gridData = GetClientValidatedEmployeeData();
                ClientValidatedEmployee employeeToUpdate = gridData.Single<ClientValidatedEmployee>(e => e.Key == editedEmployee.Key);

                // Update the Employee information to match the edited Employee data
                // In this demo we do not need to update the database since we are using Session
                // In your case you may need to actually hit the database
                employeeToUpdate.Custom = editedEmployee.Custom;
                employeeToUpdate.Email = editedEmployee.Email;
                employeeToUpdate.Integer = editedEmployee.Integer;
                employeeToUpdate.Link = editedEmployee.Link;
                employeeToUpdate.Number = editedEmployee.Number;
                Session["ValidationDataSource"] = gridData;

        public class ClientValidatedEmployee
            public int Key { get; set; }
            public int Integer { get; set; }
            public double Number { get; set; }            
            public string Email { get; set; }
            public string Link { get; set; }
            public int Custom { get; set; }                      

        public List<ClientValidatedEmployee> GetClientValidatedEmployeeData()
            List<ClientValidatedEmployee> list = new List<ClientValidatedEmployee>();
            if (Session["ValidationDataSource"] == null)
                list.Add(new ClientValidatedEmployee
                    Key = 1,
                    Integer = 20000,
                    Number = 40000000.34,
                    Email = "john.smith@yahoo.com",
                    Link = "http://www.yahoo.com",
                    Custom = -1
                list.Add(new ClientValidatedEmployee
                    Key = 2,
                    Integer = 1000,
                    Number = 460000.21,
                    Email = "justin.doe@gmail.com",
                    Link = "http://www.gmail.com",
                    Custom = 5
                list.Add(new ClientValidatedEmployee
                    Key = 3,
                    Integer = 134000,
                    Number = 5220.34,
                    Email = "deborah.long@hotmail.com",
                    Link = "http://www.hotmail.com",
                    Custom = -3
                list = Session["ValidationDataSource"] as List<ClientValidatedEmployee>;

            return list;
Switch theme:

Theming is based on the very popular jQuery ThemeRoller standard. This is the same theming mechanism used by jQuery UI and is now a de-facto standard for jQuery based components. The benefits of using ThemeRoller are huge. We can offer a big set of ready to use themes created by professional designers, including Windows-like themes (Redmond), Apple-like theme (Cupertino), etc. In addition to that any jQuery UI controls on the same page will pick the same theme.

Last, but not least, you can always roll your own ThemeRoller theme, using the superb Theme Editor

To use a theme, simply reference 2 Css files in your Html <head> section - the ThemeRoller theme you wish to use, and the jqGrid own ThemeRoller Css file. For example (Redmond theme):

<link rel="stylesheet" type="text/css" media="screen" href="/themes/redmond/jquery-ui-1.8.2.custom.css" />
<link rel="stylesheet" type="text/css" media="screen" href="/themes/ui.jqgrid.css" />