Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
515
Regarding igvalidation in iggrid in asp.net core mvc
posted

Hello  everyone,

So , I created a mvc project to bind and display data in igrid. The data binding and display part is done but now i want to apply validation in each column. I m confused how to do that. Can anyone please help me out with it with suitable example. The documentation shows use of igvalidator by targeting each element with id. but i have not created any elements i have created columns in grid and displayed data.

Here's my view code Please let me know how to apply validation and custom error messages with validations.

@using Infragistics.Web.Mvc;
@using System.Text.Json

@*@model IEnumerable<GridTransaction.Models.Student>*@
@* The Ignite UI for MVC Grid data source uses LINQ and therefore only accepts instances of IQueryable<T>.
Even when you opt to use the GridMode you will explicitly set the DataSource property which
requires an instance of IQueryable<T> .*@


<html>
<head>

</head>
<body>

<div>
<table id="grid">

</table>
</div>

<div class="text-center">
<button id="savechanges" class="btn btn-primary">Save</button>
</div>




</body>
</html>

@section scripts{

@*Batch Update*@
<script>
$(function () {
$("#grid").igGrid({
primaryKey: "id",
renderCheckboxes: true,
autoGenerateColumns: false,
updateUrl: "/Student/put/",
width: "100%",

columns: [
{ headerText: "Student ID", key: "id", dataType: "number", width: "15%" },
{ headerText: "Student Name", key: "name", dataType: "string", width: "30%" },
{ headerText: "Marks", key: "marks", dataType: "number", width: "30%" },
{
headerText: "Image",
key: "imagepath",
dataType: "string",
width: "15%",
template: "<img src='${imagepath}' width='50' height='50' />"
},
{ headerText: "Subject", key: "subject", dataType: "string", width: "15%" }
],
dataSourceUrl: "/Student/Data12",
dataSource: "/Student/Data",


features: [
{
name: "Selection",
mode: "row",
multipleSelection: true
},
{
name: "RowSelectors",
enableCheckBoxes: true,
enableRowNumbering: true
},
{
name: "GroupBy"
},
{
name :"Paging",
type:"local",
pageSize : 7
},

{
name: "Filtering",
columnSettings: [
{
columnKey: "selectColumn",
allowFiltering: false
}
]
},
{
name: "Sorting",
type: "remote",
// sortUrlKey: 'sort',
// sortUrlKeyAscValue: 'asc',
// sortUrlKeyDescValue: 'desc'
},
{
name: "Updating",
enableAddRow: true,
editMode: "row",
validation: true,
enableDeleteRow: true,
rowAdded: function (evt, ui) {
// Custom logic to execute when a row is added
console.log("Event arguments (ui):", ui);
console.log("Row data:", ui.rowId);
console.log(typeof (ui.values));
},
columnSettings: [
{
columnKey: "id",
readonly: true

},
{
columnKey: "name",
readonly: true,
required: true,

}
]
}
]
});

$("#savechanges").on("click", function () {
alert("Save button clicked");
// Save changes when the button is clicked
$("#grid").igGrid("saveChanges");
});
});

</script>


}





  • 0
    Offline posted

    You’ve come to the right place if you are looking for a high-profile Call Girl in Safdarjung. We have the finest of the best. Our independent Safdarjung Escorts have curvy bodies and are eager to please their customers. Call Girl is always there to ensure the safety and privacy of our customers.

  • 0
    Offline posted

    Call Girls from Kingsway Camp are well-known for possessing an unparalleled elegance and charm. With their stunning eyes, charming smiles, and impeccable sense of style, Kingsway Camp escort services never fail to leave an impression. Kingsway Camp Escort Service are adept at pulling off any look, whether they are clothed in stylish western wear or traditional sarees.

  • 0
    Offline posted

    One of the best features of igValidation in igGrid is its robust client-side validation. It helps ensure data integrity by catching errors before they reach the server, improving user experience and reducing server load.
    mobile toilets for hire gis security company in kenya

  • 0
    Offline posted

    Integrating igValidation with igGrid in ASP.NET Core MVC is straightforward. The documentation provides clear nairobi escorts instructions, making it easy to set up gulf escorts and customize validation kenyan porn rules for grid inputs.

  • 0
    Offline posted

    24/7 availability is guaranteed for Mumbai Call Girls and models. These young girls have undergone extensive training to bring you to the height of sexual satisfaction and pleasure. If you cannot visit one of our many convenient sites around India, we will gladly come to you!