Telerik Forums
UI for ASP.NET MVC Forum
1 answer
279 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
344 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
134 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
111 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
303 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
328 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
669 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
216 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
7 answers
3.1K+ views
Hi,
I'm very new to Kendo and inthis case, ASP.NET so your help would be appreciated.  I'm creating a web page using ASP.NET MVC4 with an entity framework over a SQL DB to create my Views and Controllers.

I've created a view that uses a Kendo grid thus:

@(Html.Kendo().Grid(Model)    
    .Name("Grid")
    .Columns(columns =>
    {
        columns.Bound(p => p.FirstName).Template(@<text>@item.FirstName</text>);
        columns.Bound(p => p.MiddleName).Template(@<text>@item.MiddleName</text>);
        columns.Bound(p => p.LastName).Template(@<text>@item.LastName</text>);
        columns.Bound(p => p.DateOfBirth).Template(@<text>@item.DateOfBirth</text>);
    })
    .Groupable()
    .Pageable()
    .Sortable()
    .Scrollable()
    .Filterable()
    )

This works really well but I would like to add another column that isn't bound to data so that I can insert some buttons for editing, deleting etc.  Ideally I'd like to show a link called 'Edit' that takes the user to another page for editing.

Many Thanks for your help!
Stefan
Telerik team
 answered on 01 Dec 2017
1 answer
349 views

In the MVC definition of the grid, I added

  .Events(e=>e.Change("gridChange"))

 

and then in the script, 

 function gridChange(){
                    var grid = $("#grid").data("kendoGrid");
                    var selectedItem = grid.dataItem(grid.select());
                    alert("Data is: "+ selectedItem.toString());
                }

Run, click on row?  Alert Data is: [Object object]

 

If I change it to    alert("Data is: "+ selectedItem[0]);

 

Run, click on row? Alert Data is: undefined.  There are 5 items in each row array, need to list them out, looking for any examples on how to do this in MVC, thanks!

Brad

Konstantin Dikov
Telerik team
 answered on 01 Dec 2017
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
Upload
ComboBox
MultiSelect
ListView
Window
TabStrip
Menu
Installer and VS Extensions
Spreadsheet
AutoComplete
TreeList
Gantt
PanelBar
NumericTextBox
Filter
ToolTip
Map
Diagram
Button
PivotGrid
Form
ListBox
Splitter
Application
FileManager
Sortable
Calendar
View
MaskedTextBox
PDFViewer
TextBox
Toolbar
MultiColumnComboBox
Dialog
DropDownTree
Checkbox
Slider
Switch
Notification
ListView (Mobile)
Pager
Accessibility
ColorPicker
DateRangePicker
Wizard
Security
Styling
Chat
MediaPlayer
TileLayout
DateInput
Drawer
SplitView
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Template
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Licensing
Rating
ScrollView
ButtonGroup
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
DateTimePicker
AppBar
BottomNavigation
Card
FloatingActionButton
Localization
MultiViewCalendar
PopOver (Mobile)
Ripple
ScrollView (Mobile)
Switch (Mobile)
PivotGridV2
FlatColorPicker
ColorPalette
DropDownButton
AIPrompt
PropertyGrid
ActionSheet (Mobile)
BulletGraph
Button (Mobile)
Collapsible
Loader
CircularGauge
SkeletonContainer
Popover
HeatMap
Avatar
ColorGradient
CircularProgressBar
SplitButton
StackLayout
TimeDurationPicker
Chip
ChipList
DockManager
ToggleButton
Sankey
OTPInput
ChartWizard
SpeechToTextButton
InlineAIPrompt
TimePicker
StockChart
RadialGauge
ContextMenu
ArcGauge
AICodingAssistant
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?