All Components
Theme

SASS Themes (beta)

    LESS Themes

      SASS Theme Builder

      Create new or customize SASS themes
      Launch Theme Builder

      Grid / Custom validator editing

      Product nameUnit priceUnits in stockDiscontinued 
      • 1
      No items to display

      Description

      In numerous scenarios there is a requirement to not only visualize data in a table structure, but also to edit and validate it before save changes.

      The MVC grid helper supports CRUD data editing operations via a simple configuration of its data source. All you have to do to enable its data editing capabilities is to:

      • set the grid's Editable configuration property:
        .Editable(editable => editable.Mode(GridEditMode.InCell))
      • declare field definitions through the Model configurator
      • configure the DataSource for performing CRUD data operations defining its Read, Create, Update and Destroy methods

      If you want to enable new records insertion, you can do that by enabling the relevant option in the grid toolbar. For deleting items you need to include a delete command column.

      In this demo you can see how defining a custom validation rule via the CustomValidationProductViewModel model and the productnamevalidation function you can force a check for first capital letter for the Product Name column, when you edit the value in it.

      For more details about the editing capabilities of the MVC Grid see the help article here.

      ASP.NET MVC source

      Also available for:

      • editing_custom_validation.cshtml
      • Editing_Custom_ValidationController.cs
      • ProductService.cs

      Support & learning resources

      Grid for other technologies