Telerik Forums
UI for ASP.NET MVC Forum
2 answers
88 views

I have a project that uses Kendo UI version 2019 R3 SP 1.

I got some issues when I do the sorting on the content that contains rich text editor (RTE).

I made some demo in the dojo (https://dojo.telerik.com/@septovan_nalysa/IsEgIxAQ)

You can open the demo try to move one of 2 contents.

The issues are the RTE that you moved:

1. becomes like a read-only/disabled field;

2. has empty value.

I tried to change the Kendo UI version 2021 R1 SP2 but I'm still facing the same issues.

 

Does anyone can help me?
Thanks.

Anton Mironov
Telerik team
 answered on 02 Apr 2021
4 answers
1.9K+ views

I am having some issues with the MVC Wrappers for Kendo UI. It seems that IEnumerable does not support any aggregate values other than count. The exception that I get is: No generic method 'Sum' on type 'System.Linq.Enumerable' is compatible with the supplied type arguments and arguments. No type arguments should be provided if the method is non-generic.  I am using System.LInq.Dynamic but this issue occurs without using a Dynamic query.

I am not sure how to get around this issues nor am I sure if it is a flaw with Kendo.
Controller

public ActionResult Index() { return View(); }
public ActionResult Read([DataSourceRequest] DataSourceRequest request) { return GetView(request); }
private IEnumerable<dynamic> GetData() { var db = new NwEntities(); return db.Products.Select("new(ProductID,ProductName,UnitPrice)"); }
private JsonResult GetView(DataSourceRequest request) { return Json(GetData().ToDataSourceResult(request)); }

View

@model IEnumerable<dynamic>
@(
 Html.Kendo().Grid(Model).Name("Grid")
    .DataSource(ds =>
        ds.Ajax()
        .Model(m =>
        {
            m.Id("ProductID");
            m.Field("ProductName", typeof(string));
            m.Field("UnitPrice", typeof(decimal));
        })
        .Aggregates(aggregate => aggregate.Add(a => "UnitPrice").Count().Sum())
        .Read(r => r.Action("Read", "Home"))
    )
    .Columns(columns =>
    {
        columns.Bound("ProductID");
        columns.Bound("ProductName");
        columns.Bound("UnitPrice").Format("{0:c}");
    })
    .Groupable()
)

I have spent a week trying to get this to work with no luck and this is a critical issue.

Tsvetomir
Telerik team
 answered on 02 Apr 2021
1 answer
317 views

Hi there. Here's my setup;

I have a grid and in the grid I bind to a column. The column has a template applied to it.

View
                    .Columns(current =>
                    {
                        current.Bound(p => p.CurrentMaterial).EditorTemplateName("ddl_Mixing_Materials_Current");
                        current.Group(g1 => g1.Title("Volumes")
                            .Columns(volume =>
                            {
                                volume.Bound(p => p.CurrentVol). EditorTemplateName("kIntegerNoSpinnerNoNegativesNamed"); <---//This one!
                                volume.Command(p => p.Custom("-20").Click("Remove20"));
                            })
                        );

Template

@model int?

@(Html.Kendo().NumericTextBoxFor(m => m)
      .Name("NumericTextBox") <-- I know this will confuse the bounding - I changed just to make next step clearer
      .HtmlAttributes(new { style = "width:100%" })
      .Decimals(0)
      .Placeholder("")
      .Min(0)
      .Max(500) <-- this is what I need to set after data binding!
      .Spinners(false)
)

 

So the issue is, I need to set the max of each column depending on the object bound to it. Each object has a 'maxVolume' that I want to use to set the 'max' value in the template. However - I looked at the API page and I tried to access the numberTextBox like it suggests, but the textbox is always 'undefined'. Here's the script and how I'm trying to access the NumericTextBox

Script

function dataBound(e) {
        var grid = this;
        grid.tbody.find("tr[role='row']").each(function () {
            var model = grid.dataItem(this);
            var maxValue = model.MaxVolume;
            alert(maxValue); <-- All good

            var test2 = $(this).find("#NumericTextBox");
            alert(test2); <-- Object found
            var numericTextBox2 = $('#CurrentVol').data('numerictextbox');
            alert(numericTextBox2); <-- 'Undefined'
            var numericTextBox3 = $(this).find("#NumericTextBox").data('kendoNumericTextBox');
            alert(numericTextBox3); < -- Still 'undefined'
        });
    }

So I'm clearly missing something. Is there some extra bit of traversal I need to do in my script because of the looping through grid rows I do? Am I looking for the wrong .data() type?

Any help would be great. thanks.

Anton Mironov
Telerik team
 answered on 02 Apr 2021
1 answer
146 views
I have a kendo spreadsheet with 1000 rows. It has a column with 1000 unique values. When I tried to give filter option to the column, the filter menu takes time to get displayed. It works fine with columns that have less values. This might have been due to the 1000 options that get displayed in the 'Filter by value' section. Is there any way to disable the Filter by value section and have only the Filter by condition section.
Aleksandar
Telerik team
 answered on 02 Apr 2021
4 answers
2.4K+ views

Hi Team,

I am using the Kendo DateTimePicker and validator to validate the dates. Please find the below code. The issue I am having is that I see the "error message" for all the fields even thought rules returns true for those field. For example, I see the error message for the fields that have return value "false" which is fine. However, after running the validator, once I click on each field, I see the error message for that field. Even though these field have return value "true" from the function I have attached. I do not understand why I see the error message for all the fields. 

1) What I want is I have two conditions in the function (if, else if). If these conditions get true, I want to display the error message. Otherwise, no error message needs to display because those dates are valid.

2) Is there a way to clear/reset the error message if there is any for a specific date field.

I really appreciate your help team. Please get back to me as soon as you can, I am waiting for your relpy.

function executeMaxMinValidationOnEachDate(datesArray) {

    //$("#validateEditableFields").kendoValidator({
    var minDate = 0;
    var maxDate = 2;
    var validator = $("#validateEditableFields").kendoValidator({
        rules: {
            datepicker: function (input) {
                var currDate = kendo.parseDate(input.val()).getTime();
                if (maxDate === 10) {
                    if (input.is("[data-role=datetimepicker]") && currDate < datesArray[minDate]) {
                        return false;
                    }
                }
                else if (input.is("[data-role=datetimepicker]") &&
                    (currDate < datesArray[minDate] || currDate > datesArray[maxDate])) {
                    minDate++;
                    currentDate++;
                    maxDate++;
                    return false;
                    //return input.data("kendoDateTimePicker").value();
                } else {
                    minDate++;
                    currentDate++;
                    maxDate++;
                    return true;
                }
            }
        },
        messages: {
            datepicker: "Please enter valid date!$$$$"
        }
    }).data("kendoValidator");
    validator.validate();
}


Mayurbhai
Top achievements
Rank 1
Veteran
 answered on 01 Apr 2021
5 answers
1.0K+ views

The Boostrap grid system gives wrong result in a Window.
The grid seems to have only 9 columns.

My View :

@(Html.Kendo().Window()
    .Name("window")
    .Title("My window")
    .Width(400)
    .Content(@<text>
    <div class="row">
      <div class="col-md-3">
        First col
      </div>
      <div class="col-md-3">
        Second col
      </div>
      <div class="col-md-3">
        Third col
      </div>
      <div class="col-md-3">
        Fourth col
      </div>
    </div>
    </text>)
)

The result is shown in the png file.

Any suggestions will be very appreciated.

Neli
Telerik team
 answered on 31 Mar 2021
3 answers
450 views

 @(Html.Kendo().TreeView()
                .Name("treeviewDetails")
                .Items(treeview =>
                {
                    treeview.Add().Text("Information")
                        .Expanded(true)
                        .Items(root =>
                        {
                            root.Add().Text("Priority" + ": " + InOnwHours);
                            root.Add().Text("Due Date" + ": " + "Today");
                            root.Add().Text("Return emails" + ": " + "example@gmail.com");
                        });

}     

 

How i can format the part of text in  root.Add().Text text ?  i need show the text after ":"  in different color, style and size. (for example example@gmail.com  in red) see attached image.

 

Thank you for help.

Dimitar
Telerik team
 answered on 31 Mar 2021
3 answers
347 views
In my Grid, using a custom PopUp editor, when adding a new record, if the user Presses Cancel, the PopUp closes appropriately but there is a blank record left at the top of my grid.  How do I prevent this from happening? I imagine I have to refresh the dataSource, but from where?  
Anton Mironov
Telerik team
 answered on 30 Mar 2021
1 answer
287 views

Is there a way to have only icons in the commands of the tree list like there is for Grid?

I manage to do this for Edit, Delete and CreateChild. But I can not do this for Update and Cancel buttons

Mihaela
Telerik team
 answered on 30 Mar 2021
7 answers
2.1K+ views

Hi Team,

 

I am using the Telerik DateTimePicker ASP.NET MVC, and I noticed that after clicking onto the calendar, once I navigate to "Time" tab of the calendar, "Hour" and "Minutes" are not aligned properly. The higher "Minute" I select does not align in the center. For example, if I select "minute" 10, then it would stay in the center of the minute column. However, if I select 58 minute, then it would not be in center of the minute column. 

Please find the attached screenshot to review the issue I am having, and please get back to me as soon as you can.

I am looking forward to hearing back from you.

 

Best,

Mayur Maisuria

Mayurbhai
Top achievements
Rank 1
Veteran
 answered on 30 Mar 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?