Telerik Forums
UI for ASP.NET MVC Forum
3 answers
262 views

I have 2 Kendo UI Listboxes, I am not able to drag items from  Model.PTLUser.RolesToRemove to the other listbox. I dont see any javascript errors in the console. My code currently looks like this. 

<div role="application" class="" id="RolesList">
    @(Html.Kendo().ListBox()
            .Name("Model.PTLUser.RolesToRemove")
            .DataValueField("RoleName")
            .DataTextField("RoleName")
            .Draggable(true)
            .DropSources("Model.PTLUser.RolesToAssign")
            .ConnectWith("Model.PTLUser.RolesToAssign")
            .BindTo(Model.RolesAvailable)
            .Selectable(ListBoxSelectable.Single)
    )
        @(Html.Kendo().ListBox()
                .Name("Model.PTLUser.RolesToAssign")
                .DataValueField("RoleName")
                .DataTextField("RoleName")
                .Draggable(true)
                .DropSources("Model.PTLUser.RolesToRemove")
                .ConnectWith("Model.PTLUser.RolesToRemove")
                .BindTo(new List<string>())
                .Selectable(ListBoxSelectable.Single)
        )
     
</div>

 

 

 

 

Irving
Top achievements
Rank 1
 answered on 07 Mar 2019
1 answer
596 views
Hi Guys,



I need to sort the column into alpha numeric using server side sorting.

The expected result would be like this below:

Test1

Test2

Test10

Test100



But the actual result becomes like this:

Test1

Test10

Test100

Test2



This can be sorted using sort compare in client side but on server side sorting, the sortCompare is always null.

Does anyone know how to properly sort this on server side?


Thanks

Georgi
Telerik team
 answered on 06 Mar 2019
3 answers
170 views

I am creating a treeview, loaded from remote hierarchical data, similar to

http://demos.telerik.com/aspnet-mvc/treeview/remote-data-binding

I am trying to understand this line in the controller:

 hasChildren = e.Employees1.Any()

I assume that the employee model has a property where it checks for children.  Where can I actually look at the model?  Can I download all the demos along with the data model?

 

 

Dimitar
Telerik team
 answered on 06 Mar 2019
6 answers
322 views
What is the equivalent to this in MVC

rowTemplate: kendo.template($("#rowTemplate").html()),

Thanks


Georgi
Telerik team
 answered on 06 Mar 2019
4 answers
1.7K+ views

I have server bound grid and a set message to be displayed when no data exists.  Below is my aspx view for the grid:

<% Html.Kendo().Grid(Model.BillingReport)
   .Name("billing_grid")
   .Columns(columns =>
   {
      columns.Bound(c => c.BillDate).Format("{0:M/d/yyyy}");
      columns.Bound(c => c.Account);
      columns.Bound(c => c.BillProgram);
      columns.Bound(c => c.Total).Format("{0:c}");
   })
   .NoRecords("No records found.")
   .Resizable(resizable => resizable.Columns(true))
   .DataSource(dataSource => dataSource.Server())
   .Render(); %>

 

On the rendered page, I see the column headers and nothing in the grid.  On the browser code, I see:

<tr class="k-no-data">
  <td colspan="5"></td>
</tr>

 

Why am I not seeing the message?

 

Preslav
Telerik team
 answered on 04 Mar 2019
1 answer
152 views

Hello Kendo UI support team,

We need convert  legacy APS.NET Form based project to MVC. In legacy project we used Telerik RadFileExploer control to handle file management. But I did not find equivalent control in Kendo UI. Is there any similar control in Kendo UI?

Thanks in advance!

Marin Bratanov
Telerik team
 answered on 01 Mar 2019
1 answer
246 views

Should the scheduler be auto generating the RecurrenceId when creating a recurrence exception? When following the example in the Documentation section I am setting things up as it says and everything seems to work except the RecurrenceId. When I create a recurrence exception the RecurrenceId is always set to null.

 

Here are some pictures with explanations:

 

Attached File 1: This is a view of the object when I am creating the recurrence exception

Attached File 2: This is a picture of what the scheduler looks like after the initial save. It looks fine and it looks like the recurrence exception is connected to the recurrence.

Attached File 3: This is a picture after the refresh. You can see that now what was supposed to be the recurrence exception is being treated as not associated with the recurrence at all.

 

 

Dimitar
Telerik team
 answered on 01 Mar 2019
8 answers
232 views

Have listbox... 

Works fine... chrome, edge... but on IE 11 scrolling does not seem to work... have to use the up/down arrows...

 

@(Html.Kendo().DropDownList()
                            .Name("admin_tableName")
                            .DataTextField("Text")
                            .DataValueField("Text")
                            .OptionLabel("- Select -")
                            .DataSource(source => source
                                .Custom()
                                .Transport(transport => transport
                                    .Read(read => read.Action("GetTableNames", "Admin"))
                                )
                            )
                            .HtmlAttributes(new { style = "width: 100%" })
                            .Events(e => e.Change("admin_tablename_change"))
            )

Edward
Top achievements
Rank 1
 answered on 28 Feb 2019
2 answers
191 views

Greetings,

I have a Telerik MVC Grid with in-line editing. It has custom validation to check if the primary key already exists, but it runs the validation when you tab out AND click "Update" in-line. How do I change the validation to occur and subsequently the error message to pop up ONLY on clicking "Update" and not when leaving the textbox? Here is my code below:

 

01.(function ($, kendo) {
02.     $.extend(true, kendo.ui.validator, {
03.         rules: { // custom rules
04.             codevalidation: function (input, params) {
05.                 if (input.is("[name='Code']") && input.val() != "") {
06.                     input.attr("data-codevalidation-msg", "Code must not already exist.");
07. 
08.                     var isGood = true;
09.                     var gridData = $("#grid").data("kendoGrid").dataSource.data()
10. 
11.                     console.log(input.val());
12.                     for (var i = 1; i < gridData.length; i++) {
13.                         console.log(gridData[i].Code == input.val().toUpperCase())
14.                         if (gridData[i].Code == input.val().toUpperCase())
15.                             isGood = false;
16.                     }
17.                     console.log("returning " + isGood);
18.                     return isGood;
19.                 }
20.                 else {
21. 
22.                     return true;
23.                     console.log("returning true at end");
24.                 }
25.             }
26.         },
27.         messages: { //custom rules messages
28.             codevalidation: function (input) {
29.                 // return the message text
30.                 return input.attr("data-val-codevalidation");
31.             }
32.         }
33.     });
34. })(jQuery, kendo);
Viktor Tachev
Telerik team
 answered on 28 Feb 2019
2 answers
126 views
  • Context:
    I am currently building a dashboard which will display multiple separate line graphs. I am using the Sass ThemeBuilder, and this is where the colors will be set (Under Chart > Series A-F) and regularly changed. The colors for these lines must match the colors of our SASS theme so they cannot be hard coded. 

  • Problem:
    Currently every chart is drawn using the colors for Series A, which makes sense since there is only a single series per chart. What I would like to do is have each chart use a different series color.

Is there a way to do this without directly passing a hard coded hex value?

Currently I am achieving this by adding a few empty series inside each chart, but would like to know if there is a tidy way of doing it.

01.<div class="col-xs-6">
02.    @(Html.Kendo().Chart().Theme("sass")
03.          .Name("lines1")
04.          .Title("g1")
05.          .Series(s =>
06.          {
07.              s.Line(new List<double>());
08.              s.Line(new List<double> {1.7, 1.63, 1.72, 1.87, 2.1, 1.2, 1, 0.9}).Name("g1");
09.          })
10.          .HtmlAttributes(new { style = "height:200px;" })
11.          )
12.</div>
13.<div class="col-xs-6">
14.    @(Html.Kendo().Chart().Theme("sass")
15.          .Name("lines2")
16.          .Title("g2")
17.          .Series(s =>
18.          {
19.              s.Line(new List<double>());
20.              s.Line(new List<double>());
21.              s.Line(new List<double> {1.7, 1.63, 1.72, 1.87, 2.1, 1.2, 1, 0.9}).Name("g2");
22.          })
23.          .HtmlAttributes(new { style = "height:200px;" })
24.          )
25.</div>
26.<div class="col-xs-6">
27.    @(Html.Kendo().Chart().Theme("sass")
28.          .Name("lines3")
29.          .Title("g3")
30.          .Series(s =>
31.          {
32.              s.Line(new List<double>());
33.              s.Line(new List<double>());
34.              s.Line(new List<double>());
35.              s.Line(new List<double> {1.7, 1.63, 1.72, 1.87, 2.1, 1.2, 1, 0.9}).Name("g3");
36.          })
37.          .HtmlAttributes(new {style = "height:200px;"})
38.          )
39.</div>
40.<div class="col-xs-6">
41.    @(Html.Kendo().Chart().Theme("sass")
42.          .Name("lines4")
43.          .Title("g4")
44.          .Series(s =>
45.          {
46.              s.Line(new List<double>());
47.              s.Line(new List<double>());
48.              s.Line(new List<double>());
49.              s.Line(new List<double>());
50.              s.Line(new List<double> {1.7, 1.63, 1.72, 1.87, 2.1, 1.2, 1, 0.9}).Name("g4");
51.          } )
52.          .HtmlAttributes(new { style = "height:200px;" })
53.          )
54.</div>
Tomo
Top achievements
Rank 1
 answered on 28 Feb 2019
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?