Telerik Forums
Kendo UI for jQuery Forum
1 answer
8 views

Hello Kendo Experts,

I'm currently working on integrating a Kendo JQuery Grid with an ASP.NET Core server-side setup that utilizes Fluent Validation for data validation. When submitting data via the grid, the server responds with a structured error message in case of validation failures, following this format:

{
    "type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
    "title": "One or more validation errors occurred.",
    "status": 400,
    "traceId": "|30c76381-41abcc1635c93e3c.",
    "errors": {
        "ProductId": [
            "'ProductId' must not be empty."
        ],
        "Quantity": [
            "'Quantity' must not be empty.",
            "'Quantity' must be greater than '0'."
        ]
    }
}



My goal is to handle these validation errors and present them to the user in a user-friendly manner within the Kendo Grid interface. This involves processing the error messages received from the server and displaying them near the corresponding input fields for easy identification and correction by the user.

Could you kindly provide guidance or suggestions on how to achieve this? Any insights or examples on how to format and display these error messages effectively within the Kendo Grid would be greatly appreciated.

Thank you for your assistance.

Martin
Telerik team
 answered on 14 Mar 2024
1 answer
28 views

I'm just migrating an application to ASP.NET Core. A couple of data forms in pop-up windows use a kendo validator. This works to validate fields and highlight required fields, but the validate function is returning false even though the error count is 0.

I'm using version v2023.3.1114 of Kendo UI for ASP.Net Core.

The validation code is:-

		var validator = $('#MetaDatafrm').kendoValidator({
			validationSummary: true,
			validate: function (e) {

				var dropDowns = $(".k-dropdown");

				$.each(dropDowns, function (key, value) {

					var input = $(value).find("input.k-invalid");

					var span = $(this).find("span.k-dropdown-wrap");

					if (input.length > 0) { //if there is an input in here with k-invalid...

						$(span).addClass("dropdown-validation-error");

					} else {

						$(span).removeClass("dropdown-validation-error");

					}

				});


			}
		}).getKendoValidator();

		var x = validator.validate();

		var errors = validator.errors();

		//alert(errors.length);

		if(errors.length==0)
		{
			x=true;
		}

		validator.showValidationSummary();

	

		if (x == false) {
			alert('Form has failed data validation. Please correct and try again');
			return;
		}

The form is loaded from a partial view loaded by:-

function editMetaData(rID, rs) {

	srcFilter=rs;

	var wind = $('#wndMetaDataEdit').data("kendoWindow");


	$('#btnSave').removeProp("disabled");
	 $('#errorMsg').hide();

	wind.refresh({
		url: "@Url.Content("~/Home/EditMetaData?reportID=")" + rID + "&src=" + rs 
		
	});
	wind.center();
	wind.open();



}

This code did work in a previous version (v2023.2.718) but that was ASP.NET MVC, not .Net core.

Neli
Telerik team
 answered on 10 Jan 2024
1 answer
586 views
I have a form on a page with inputs. Some are kendo dropdownlists, some are basic html inputs, etc. That form uses a kendo validator. Normally when I want a field to be required I just add the required attribute to the input or select. That is what I'm doing here. Where the question arises is that as the user is doing other things on the page some of the fields in my form become not required or required again. How do I dynamically change the required state of a field in a kendo form after the form controls and validator have been initialized? Can I simply remove the required attribute from the basic html form element or must I do something more?
Zornitsa
Telerik team
 answered on 19 Sep 2023
1 answer
180 views

Hello kendo,

When an user is entering the date with an invalid format like dd.mm.yyyy (so 27.06.2023) into our datepicker, it looks like the date is accepted in the UI, but the value is actually empty. What is confusing for the user. To fix this we would like to clear the value when an user entered an invalid date. How can we do this ?

I found an example for the datetimepicker, but it requires an initial filled in date, if you start with an empty value it's not working. The problem comes from the problem that it's impossible to tell if the value is empy or invalid.

https://docs.telerik.com/kendo-ui/knowledge-base/prevent-invalid-values
PS the script has an bug and is not working, add to following to the script to get it working:   

        $("#datetimepicker").kendoDateTimePicker({
          change: onChange,
          close: onClose,
          open: onOpen,
          value: new Date()
        });
        var lastValidDate = $("#datetimepicker").data('kendoDateTimePicker').value();
      });
    </script> 

Regards,
Jeroen

Nikolay
Telerik team
 answered on 30 Jun 2023
0 answers
47 views

Hai,

I have two questions : 

1) How can I change the width of a GridColumn, as show below? I am currently using GridColumn. Please find attached as reference.

2) How can I use Kendo UI to create a bar graph like the one shown below? The graph should update based on the user-entered values for total occurrence and time period (week/month). Does Kendo UI support this functionality?


 

Umi Amira
Top achievements
Rank 1
Iron
 asked on 03 May 2023
1 answer
39 views

Dear Experts ,

I am currently working on a financial related project where I am using the Kendo Spreadsheet . However, I am facing an issue with regards to authentication and data validation.

Specifically, I would like to know if there is a solution in the Kendo Spreadsheet that can validate authentication with an integrated app before loading data and triggering data to the database.

I have researched this topic extensively, but I have not been able to find a clear solution. Therefore, I am reaching out to the community to seek your guidance and insights. Have any of you faced a similar issue? If so, how did you address it?

Any advice or solution that you can provide on this matter would be greatly appreciated. Thank you in advance for your help and expertise.

Neli
Telerik team
 answered on 13 Apr 2023
3 answers
105 views

Hi,

     Like Demo https://dojo.telerik.com/ojOwIcIB 

     I want to change field [attendees] validation message when field input value is empty,

     I referred

              https://www.telerik.com/forums/kendo-scheduler-change-field-validation-message 

              and 

              https://dojo.telerik.com/AsAjOdiv

     Like this :

               e.container.find("[data-container-for=attendees] select[data-role=multiselect]").attr("data-required-msg", "New Validation Message!");

     It's not work....

     Thank you very much for your help. 

sun
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 20 Jul 2022
1 answer
44 views

Hi,

     Like Demo : https://dojo.telerik.com/ExuQuSoT

     Field title and description validation require is set true.

     I have a business need :

     When I choose Meeting Room 201 for Field RoomId, I hope that I can mask or turn off the validation and submit it normal.

     How to realize it?

     Thank you very much for your help. 

     

      

Martin
Telerik team
 answered on 14 Jul 2022
1 answer
77 views

Hi,

     Like Demo https://demos.telerik.com/kendo-ui/scheduler/timeline

     I want to change field start validation message when field input value is empty,

     Like this:

              start: { type: "date", from: "start", required: {message: "my validation message"} }

     It's not work....

     Thank you very much for your help. 

     

Martin
Telerik team
 answered on 03 Jun 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?