Telerik Forums
UI for ASP.NET MVC Forum
6 answers
2.3K+ views

Hi,

 I've have to use Kendo Grid in several languages but in the same decimal and dates format (fr-FR). I managed to change Kendo language.

 I also add the script and add the routine to change kendo culture.

 

<head>
...
    <script src="~/Scripts/Kendo/cultures/kendo.culture.fr-FR.min.js"></script>
    <script>
        kendo.culture('fr-FR');
    </script>
</head>

I also add in web.config;

<system.web>
    <globalization culture="fr-FR" />
 </system.web>

If I put a breakpoint and examine kendo variable, i have kendo.cultures.current = 'fr-FR'. The culture file is correctly included in page sources.

 Yet, the display format remains incorrect and when I edit a grid inline, I also have problems with validation.

 Am I missing something?

Stefan
Telerik team
 answered on 08 Dec 2017
4 answers
243 views

I have a kendoGrid initialized in cshtml. It uses ajax binding.

The grid model looks like { int id, int typeId, string name, string value }.
The grid has 2 columns Name and Value and Value is editable InCell. For now grid works well with using by default usual textbox as editor. I have to improve the grid to have possibility of using different controls in the "value" field depending of the value of "typeId". I tried to use custom EditorTemplate for that but I cannot find a way to pass typeId to the template (the column is bound to "value"). Is it possible to pass there an extra parameter from the grid model or reach it out from the template somehow?

Regards, Alexey

Here is the link to the same post on Stackoverflow:

https://stackoverflow.com/questions/47577527/using-different-controls-in-a-editable-column

Ravish
Top achievements
Rank 1
 answered on 07 Dec 2017
1 answer
274 views
Is it possible to use id and parentId to build the diagram instead of using a list of children objects in each node?
Stefan
Telerik team
 answered on 07 Dec 2017
1 answer
329 views

Hi,

I try to use the kendo mvc upload control.

I linked to this demo:

http://demos.telerik.com/aspnet-mvc/upload/async

In some computers it works fine, but on another (tested on chrome + IE) the control works as expected but the progress bar not working.

The progress bar become full at the beginning and the percentages are not shown.

The computer settings:

Windows server 2012 R2, 64 bit.

Chrome version: 62.0.3202.94 (Official Build) (64-bit)

IE version: Internet Explorer 11 version: 11.0.9600.18639.

 

Thank you for help,

Elad.

 

 

 

 

 

 

Ianko
Telerik team
 answered on 06 Dec 2017
4 answers
125 views

Hi,

I am trying to apply the functionality from Resize and Expand Grid

https://docs.telerik.com/kendo-ui/controls/data-management/grid/how-to/Layout/resize-grid-when-the-window-is-resized

to the TreeList.

I have tried tree.Scrollable(true); as an equivalent for grid.Scrollable(scrollable => scrollable.Height("auto")); but it does not work. At least the classes on content are not the same.

Can this be achieved? How can I have resize and Expand TreeList to 100% Height?

Dan
Top achievements
Rank 1
Iron
Iron
Veteran
 answered on 06 Dec 2017
1 answer
103 views

Hello,

I'm trying to use serverFiltering with Razor, but when I step through my code I can see that Filtering is always Null. Here's my code - can someone see what the issue may be?

@(Html.Kendo().Grid<DAL.ViewModels.Lists.AccountList>()
            .Name("kendogridvpc")
            .Columns(columns =>
            {
            columns.Bound(c => c.FirstName).Width(175);
            columns.Bound(c => c.LastName).Width(175);
            columns.Bound(c => c.Email);
            columns.Bound(c => c.Role).ClientTemplate("<i class='fa fa-shield' aria-hidden='true' title='PF: #: PFN #'></i> #: Role #").MinScreenWidth(480);
            columns.Bound(c => c.Id).Hidden();
            columns.Bound(c => c.LatestHPFormId).Hidden();
            columns.Bound(c => c.RoleId).Hidden();
            columns.Bound(c => c.isClosed).Hidden();
            columns.Bound(c => c.IsLockedOut).Hidden();
            columns.Bound(c => c.IsApproved).Hidden();
            columns.Bound(c => c.IsLatestHPFormOnline).Hidden();
            columns.Template(@<text>Hello</text>)
                    .Title("Status")
                    .MinScreenWidth(480)
                    .Width(120)
                    .ClientTemplate("# if (IsApproved) { #<span class='user-approved'><i class='fa fa-check-circle-o' aria-hidden='true' title='Account Approved'></i></span> # } else { # <span class='user-unapproved'><i class='fa fa-check-circle-o' aria-hidden='true' title='Account Not Approved'></i></span> #}# # if (HPFormHasIssues) {#<span class='user-highlight' title='Highlighted Issues'><i class='fa fa-exclamation-triangle' aria-hidden='true'></i></span>#}# # if (isClosed) {# <span class='user-highlight' title='Account Closed'><i class='fa fa-archive' aria-hidden='true'></i></span> #} else {# #if (IsLockedOut) {#<span class='user-highlight' title='Account Suspended'><i class='fa fa-lock' aria-hidden='true'></i></span> #}# #}#");
                columns.Command(command => command.Custom("Actions").HtmlAttributes(new { @class = "btn-primary" }).Click("showMenu")).Width(110);
            }
        )
        .Pageable()
        .Sortable()
        .Filterable(ftb => ftb.Mode(GridFilterMode.Menu)
            .Operators(ops => ops.ForString(str => str.Clear()
                .StartsWith("Starts with")
                .IsEqualTo("Is equal to")
                .IsNotEqualTo("Is not equal to")
                .Contains("Contains")
                .DoesNotContain("Does not contain")
        )).Enabled(true))
        .DataSource(dataSource => dataSource
            .Custom()
            .Type("aspnetmvc-ajax")
            .PageSize(10)
            .ServerPaging(true)
            .ServerSorting(true)
            .ServerFiltering(true)
            .Filter(filters => {
                filters.Add<string>(f => f.FirstName).IsNotNull();
            })
            .Schema(schema =>
            {
                schema.Data("Data");
                schema.Total("Total");
                schema.Model(model =>
                {
                    model.Id("Id");
                    model.Field("FirstName", typeof(string));
                    model.Field("LastName", typeof(string));
                    model.Field("Email", typeof(string));
                    model.Field("Role", typeof(string));
                    model.Field("RoleId", typeof(Guid));
                    model.Field("isClosed", typeof(bool));
                    model.Field("IsLockedOut", typeof(bool));
                    model.Field("IsApproved", typeof(bool));
                });
            })
            .Transport(transport =>
            {
                transport.Read(read => read.Action("Users_Read", "User").Type(HttpVerbs.Get));
                transport.ParameterMap("parameterMap");
            })
)
)
Stefan
Telerik team
 answered on 06 Dec 2017
1 answer
293 views

 

I'm trying to put a listbox in a popup editor for a grid. However, whenever I do I get an error. It works fine in forms, base indexes, etc.

Here is an example of the listbox I'm creating. It's very simple and impossible for it to have any object issues/etc. This thing literally should have zero problems.

@(Html.Kendo().ListBox()
            .Name("optional")
            .Toolbar(toolbar =>
            {
                toolbar.Position(Kendo.Mvc.UI.Fluent.ListBoxToolbarPosition.Right);
                toolbar.Tools(tools => tools
                    .TransferTo()
                    .TransferFrom()
                    .TransferAllTo()
                    .TransferAllFrom()
                    .Remove()
                );
            })
            .ConnectWith("selected")
            .BindTo(new List<string>() { "Test", "Test 2" })
)

@(Html.Kendo().ListBox()
            .Name("selected")
            .BindTo(new List<string>())
            .Selectable(ListBoxSelectable.Multiple)
)

However, when it's placed inside a template in the EditorTemplates folder I get this javascript error:

kendo.all.js:9244 Uncaught TypeError: e.value is not a function
    at init.refresh (kendo.all.js:9244)
    at init.bind (kendo.all.js:8485)
    at r.applyBinding (kendo.all.js:9486)
    at r.bind (kendo.all.js:9436)
    at s (kendo.all.js:9579)
    at s (kendo.all.js:9588)
    at s (kendo.all.js:9588)
    at s (kendo.all.js:9588)
    at Object.a [as bind] (kendo.all.js:9603)
    at init.refresh (kendo.all.js:42964)

I have absolutely no idea why. Can anyone explain to my why this happens or more importantly - how to get a listbox inside the editor popup for a grid?

Stefan
Telerik team
 answered on 05 Dec 2017
3 answers
320 views

Hello,

how can I set an initial value if the control has serverfiltering is true?

http://demos.telerik.com/aspnet-mvc/combobox/serverfiltering

To be clearer we have a multipage wizard where you can navigate between his pages. On the first page we have some comboboxes with a large datasoure (200k~ items). So we set the combobox to filter on server which works well. We got the entered text and fire a contains query against the database. If the user now submits the form with the combobox in it, we store the key value (15) in die session. After a while the user decides to choose an other value from that combobox and opens the page of it. Now we want to show the previous selected value in that combobox, but how? We have first tried to set its value via javascript .value(15) but that shows the 15 in the combobox but not the text (Tofu). How can we force to select the data from the server if it is not loaded? With .text("Tofu") it shows the tofu but has no key value :( thats maybe because we have multiple items with name Tofu but with diffrent ids.

Thank you!
Ivan Danchev
Telerik team
 answered on 01 Dec 2017
1 answer
657 views
My Issue is that once I had upgraded to version 2017.3.913,  pre-populating the multiselect did not work.

The Ajax does return data, and throws no error when setting the value.

I have also tried a default random value to see if I could get a dummy pre selected value and nothing.

Is there another way to set value with text and id into the multiselect field.

Thank You.

Example of code below.

<table style="width:100%; margin:0px; padding:0px;">
                <tr>
                    <td style="margin:0px; padding:0px;position:relative;">
                        @(Html.Kendo().MultiSelect().Name("VesselMultiDropDown")
                            .DataTextField("Text").DataValueField("Value")
                            .Filter("contains")
                            .IgnoreCase(true)
                            .DataSource(source =>
                            {
                                source.Read(read =>
                                {
                                    read.Action("JsonGetJobVisitExporWithBarcodeStatusOnlytMultiDropDown", "DropDown").Data("getEnvironment");
                                })
                                .ServerFiltering(true);
                            })
                            .AutoClose(false)
                            .AutoBind(false)
                            
                                    .HtmlAttributes(new { style = "width:100%-22px;margin-right:22px;" })
                            .Placeholder("Select vessel...")
                        )
 
                    </td>
                </tr>
            </table>

 

jQuery(window).load(function () {
 
       $.ajax({
           url: "@Url.Action("GetSessionVessels", "Barcode")",
           type: 'POST',
           traditional: true,
           success: function (dataVessels) {
 
               $("#VesselMultiDropDown").data("kendoMultiSelect").value(dataVessels);
                
           }
       });
   });
Neli
Telerik team
 answered on 01 Dec 2017
1 answer
207 views

Hi,

I'm trying to determine whether there is a clash with an occupied time slot when creating an event with a recurrence. I am able to make this determination when dealing with a daily recurrence. When I try using weekly recurrence only the first occurrence is returned and nothing else when using the occurrencesInRange method.

 

Here is my code:

function scheduler_save(e) {

        var scheduler = $("#scheduler").getKendoScheduler();
    if (e.event.recurrenceRule != 'undefined' && e.event.recurrenceRule != '') {
            
                var nextOccurrence = e.event.expand(e.event.start, new Date(2999, 0, 1), "Etc/UTC");
                for (var idx = 0, length = nextOccurrence.length; idx < length; idx++) {
                   var occurrences = scheduler.occurrencesInRange(nextOccurrence[idx].start, nextOccurrence[idx].end);
                    
                    if (occurrences.length > 0) {
                        msg += nextOccurrence[idx].start + '\n';
                        
                    }
                }
                if (nextOccurrence.length > 0) {
                    
                    alert(msg);
                }
                

        }
        else {
            if (!checkAvailability(e.event.start, e.event.end, e.event, e.event.resources)) {

                e.preventDefault();
            }

        }
}

Would anyone be able to point me in the right direction.

 

Thank you.

 

Phil

Veselin Tsvetanov
Telerik team
 answered on 01 Dec 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?