Telerik Forums
UI for ASP.NET MVC Forum
1 answer
142 views
I am currently using .NET Framework 4.5.1 in my ERP system, and we are using Kendo UI for ASP.NET MVC version 2019.1.220. I would like to upgrade to a newer version of Kendo UI, but I am unsure which versions beyond 2019.1.220 are compatible with .NET Framework 4.5.1. Could you please provide information on the latest compatible version?
Eyup
Telerik team
 answered on 27 Aug 2024
0 answers
118 views
Im trying to find a way to continue with upload of multiple files if one fails. I have a check on Save that if file names is longer then 100 chars, it will return a error. Upload will stop on that file, and will only continue when user click on X button to remove the file. I need for kendo upload to continue with the upload of other files without user having to click on X button for each file that files. 
Bexel Consulting
Top achievements
Rank 1
Iron
Iron
 asked on 07 Aug 2024
0 answers
92 views

After upgrading Kendo MVC from v2021.2.616 to v2024.2.514 (KendoUIProfessional), the dropdownlist "SeriesType" on the grid is not firing the onChange event anymore. I saw an error message in the browser console.

Can you guys suggest a migration solution for it? Thanks!

Browser console error:

cshtml

@(Html.Kendo().Grid<MySeriesModel>().Name("drpSeries")
              .Columns(column =>
              {
                  column.Bound(model => model.SeriesName).HtmlAttributes(new { style = "font-weight: bold" }).Title("No.").Width(40);
                  column.ForeignKey(c => c.SeriesType, (IEnumerable<SelectListItem>)ViewBag.LstSeriesType, "value", "text").HtmlAttributes(new { style = "text-align: left", onChange = "onChangeSeriesType('#=ID#'); setSerieXml();" }).Title("Series Type").MinScreenWidth(60);
                  column.Bound(model => model.SeriesTitle).Title("Series Title").HtmlAttributes(new { onChange = "setSerieXml();" }).MinScreenWidth(120).Encoded(false);
                  column.Bound(model => model.Axis).Title("Axis").ClientTemplate("#=getAxisActionLink(ID,Axis)#").MinScreenWidth(120);                  
                  column.ForeignKey(c => c.Y_Format, (IEnumerable<SelectListItem>)ViewBag.LstSeriesFormat, "value", "text").HtmlAttributes(new { style = "text-align: left", onChange = "onChangeFormat(this);" }).Title("Format").MinScreenWidth(150);
                  column.ForeignKey(c => c.Y_Axis, (IEnumerable<SelectListItem>)ViewBag.ListSerriesYAxis, "value", "text").HtmlAttributes(new { style = "text-align: left", onChange = "onChangeYAxis(this,'#=ID#');" }).Title("Y Axis Scale").Width(100);
                  column.Bound(x => x.ID).ClientTemplate("<button class= 'k-button' type='button' onclick=onRemoveSeries('#=ID#')>" + "Remove" + "</button>").HtmlAttributes(new { style = "text-align: center" }).Title("").Width(120);
              })
              .DataSource(dataSource => dataSource
                    .Ajax()
                    .ServerOperation(false)
                    .Model(model =>
                    {
                        model.Id(item => item.ID);
                        model.Field(item => item.ID).Editable(false);
                        model.Field(item => item.SeriesName).Editable(false);
                        model.Field(item => item.Axis).Editable(false);
                        model.Field(item => item.SeriesTitle).Editable(false);
                    })
                    .Read(read => read.Action("SeriesList_DataSource", "Dashboard").Data("getDataForDgdSeries_Read"))
               )
               .Events(e =>
               {
                   e.DataBound("onDataBoundDgdSeries");
               })
               .Resizable(x => x.Columns(true))
               .AutoBind(true)
               .Scrollable(x => x.Enabled(true))
               .Editable(editable => editable.Mode(GridEditMode.InCell))
               .Selectable(selectable => selectable.Mode(GridSelectionMode.Single))
               .HtmlAttributes(new { style = "overflow: auto; width:100%", @class = "form-group" })

)

JS

function onChangeSeriesType(id) {
    drpSeries = $('#drpSeries').data('kendoGrid');
    dataSource = drpSeries.dataSource;
    var lstSerieRow = dataSource.data();
    if (lstSerieRow[id - 1].Axis.length > 0) {
        lstSerieRow[id - 1].SeriesTitle = "";
        lstSerieRow[id - 1].Axis = "";
        dataSource.fetch();
    }
}

Model

public class MySeriesModel
{
    public string ID { get; set; }

    public string SeriesName { get; set; }
    public string AxisName { get; set; }
    public string Axis { get; set; }
    [AllowHtml]
    [UIHint("GridDropDownList")]
    public string SeriesType { get; set; }

    public string SeriesTitle { get; set; }

    public string X_Ordinate { get; set; }

    public string X_Format { get; set; }

    [AllowHtml]
    [UIHint("GridDropDownList")]
    public string Y_Format { get; set; }

    [AllowHtml]
    [UIHint("GridDropDownList")]
    public string Y_Ordinate { get; set; }
    [AllowHtml]
    [UIHint("GridDropDownList")]
    public string Y_OrdinateTo { get; set; }
    public string TOOLTIP_FORMAT { get; set; }

    [AllowHtml]
    [UIHint("GridDropDownList")]
    public string Y_Axis { get; set; }
}

controller


public ActionResult RenderSeriesConfig(string viewName)
{
    List<SelectListItem> seriesType = GetDashboadChartStyleTypeList();
    string arrSeriesType = "";
    for (int i = 0; i < seriesType.Count; i++)
    {
        arrSeriesType += seriesType[i].Text.ToString() + "," + seriesType[i].Value.ToString() + ";";
    }
    ViewBag.LstSeriesType = seriesType;
    ViewBag.ArrSeriesType = arrSeriesType;
    ViewBag.LstSeriesAxis_Ordinate = GetLstFieldNamesSelectListItem(viewName);
    ViewBag.LstSeriesFormat = GetFormatShortList();
    ViewBag.ListSerriesYAxis = GetYAxisSettingList();
    return PartialView("_ChartDetail_Series");
}

 

Ronan
Top achievements
Rank 1
 asked on 07 Aug 2024
1 answer
97 views

A bug has been introduced recently where the calendar icon for DatePicker does not display

I can duplicate this bug using your REPL

https://demos.telerik.com/aspnet-core/datepicker

From here I add after line 9

.HtmlAttributes(new { @style = "width: 150px;"})

As you can see this results in no calendar to pick the date

If you make it even wider some of the icon becomes visible

.HtmlAttributes(new { @style = "width: 200px;"})

And at 250 it is fully visible

.HtmlAttributes(new { @style = "width: 250px;"})

We do this across our app using an extension method and it was previously working.

        public static DatePickerBuilder Width(this DatePickerBuilder builder, int width)
        {
            builder.ToComponent().HtmlAttributes.Merge("style", "width:" + width.ToString() + "px");
            return builder;
        }
Ivan Danchev
Telerik team
 answered on 02 Aug 2024
1 answer
90 views

Hi,

I showing a grid where some columns has username information. when a user is inactive then the username has a strike trough styling by class

This column is a a ForeignKey with ClientTemplate for displaying and the EditorTemplateName to control the editing

what shows a dropdown with Template and ValueTemplate on the UIHint schtml.

And  event databound to add a class for the strike trough styling.

So my grid column and dropdwon during edit are all having styling for inactive users

But when I click the filter icon the dropdown has to do the same

Where do I do that?

I cannot find any template or something else to control the ForeignKey bound dropdown.

Can someone help me with this styling problem?

Thanks

Alexander
Telerik team
 answered on 30 Jul 2024
1 answer
170 views

Summary 

Struggling with this issue for weeks now. Please need help! 

Goal - Stop the wizard from going to next step when there is a custom validation

Issue : The custom validation "Min age has to be 16 years " shows up on Validation blur , but does not stop the propagation to the next step.

validator.validate() comes up as true in both form and div approach

 

First approach

1. Addded a kendo wizard with a  .Tag("div") tag so that 4 steps in there show up as individual forms

@(
    Html.Kendo().Wizard()
    .Name("LicenseWizard")
    .Tag("form")
    .Steps(s =>
    {

        s.Add<WizardViewModel>()
        .Title("County")
        .ClassName("CountyClass")
       .Form(f => f
        .Name("FormCounty")
        .FormData(Model)

... There are 4 steps in total

 

2. Used this in the Onselect step method 

           

function onSelect(e) {

    // Get the current step's index
    var stepIndex = e.step.options.index;

    // Get the current step's container element
    var container = e.sender.currentStep.element;

    if (stepIndex < currentStep) {
        e.preventDefault();
    }
    else {

        // Validate Party One
        if (stepIndex == 2) {

            var form = $("#LicenseWizard-1").find('form');

             var validator = form.data("kendoValidator");


            alert('validator.validate()' + validator.validate());

            // Validate given input elements
            if (!validator.validate()) {
                // Prevent the wizard's navigation
                e.preventDefault();

}

Shows true and goes to next step

 

Second approach 

1. Use the .Tag("form")

 

 @(
     Html.Kendo().Wizard()
     .Name("LicenseWizard")
     .Tag("div")
     .Steps(s =>
     {

         s.Add<WizardViewModel>()
         .Title("County")
         .ClassName("CountyClass")
         .Form(f => f
         .Name("FormCounty")
         .FormData(Model)
         .Items(items =>

 

2. In the

 

// Validate
if (stepIndex == 2) {

    var form = $("#LicenseWizard-1").find('form');

     var validator = form.data("kendoValidator");
    // Instantiate a validator for the container element


    // Get the validator's reference
    var validator = $(container).kendoValidator().data("kendoValidator");

    alert('validator.validate()' + validator.validate());

    // Validate given input elements
    if (!validator.validate()) {
        // Prevent the wizard's navigation
        e.preventDefault();

 

Even this returns true

  • Custom rules at the begining , which work on validate blur

 $(function () {
     $("#LicenseWizard").kendoValidator({
         rules: {
             requiredIfValue: function (input) {
                 //debugger;

if (input.is("[data-val-requiredifvalue]") && !input.val()) {

....

}

minagedate: function (input) {



    if (input.is("[id ='PartyOne.Pty1DateOfBirth']") || input.is("[id ='PartyTwo.Pty2DateOfBirth']")) {
        var value = $(input).val();
     ...............// 

        //console.log('todayMinus16' + todayMinus16);

        var result = (todayMinus16 >= birthdate);

        return result;
    }

 

   Question : minagedate validate on blur works . When I click on next , on Step 2 , the container in the approach when i use a div tag on wizard is the form that I get manually and in the second approach it is container that I get using the step method. 

 

I defined rules at the main wizard level ----

 $(function () {
     $("#LicenseWizard").kendoValidator({

 

how can make the validator.validate() false in my steps when there is something on the custom rules (that also show up on validate on blur) ? 

 

 

 

Mihaela
Telerik team
 answered on 26 Jul 2024
1 answer
127 views

I skipped 2024.1.319 so can't confirm if this behavior exists in that version.

Attached is screenshot of the first page (with blacked out redacted information).  The 2024.1.130-exporttopdf-grid.png show expected/as is function of exporting a grid of data to pdf.

2024.2.514-exporttopdf-grid.png shows what the same data and grid.  There is an "Exporting..." overlay message and the last row of data appears to be repeated and offset.

Is this a bug in 2024.2.514?

Eyup
Telerik team
 answered on 23 Jul 2024
1 answer
104 views
when i click my dropdown list(Multiselect)it is not opening in my application. Please note the same is working fine in trial version(2022.1.119.545) but stop working when i moved to licensed version(2022.2.510.545)
Anton Mironov
Telerik team
 answered on 11 Jul 2024
1 answer
305 views

In a normal form which uses html validation adding required to a KendoDropDownList fails

 

Ive tried to research to find a solution, but its due to the field being hidden field behind the control

Thus you end up with an error similar to this

An invalid form control with name='CountryId' is not focusable. 

 

I wish to know the proper way to show a validation message for a required dropdownlist in MVC

Ivaylo
Telerik team
 answered on 11 Jul 2024
1 answer
75 views
In my ASP.NET  MVC existing project we have used trail Telerik UI for ASP.NET  MVC version 2022.1.119.545 and after that we have upgraded to developer version 2022.2.510.545 we have facing issue with dropdown with multi select checkbox not working in developer version
Eyup
Telerik team
 answered on 11 Jul 2024
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?