Telerik Forums
UI for ASP.NET MVC Forum
1 answer
20 views

Is this because I have an older version of Kendo? When were row templates added?

Anton Mironov
Telerik team
 answered on 12 Feb 2024
1 answer
36 views

Hi All,

We're using telerik kendo treelist for the application. we need functionality like if we click on Copy data button then it will clone the selected row along with data. We've tried to find copy functionality but we're not able to do it. so we have add custom button ("Copy Data"). 

Please let us know if there is any other way to achieve this functionality.

adding button "Copy Data"  in toolbar:


.Toolbar(tb =>
    {     
            tb.Custom().Name("Copy").Text("Copy Data");        
    })

"Copy Data" button click event:

$('.k-button-text').click(function () {
        alert('clicked');
        debugger
        var treeList = $("#TeamTreeList").data("kendoTreeList");
        var row = treeList.select();
        if (row.length > 0) {
            var data = treeList.dataItem(row);
            console.log(data.RoleName); 
        }
    });

 

 

 

Anton Mironov
Telerik team
 answered on 26 Jan 2024
1 answer
142 views

Greetings,

 

I'm working on an issue with our Kendo UI...essentially i have a parent node and i want to add a child node and have the change show up immediately like it does in the Kendo UI example.  Upon clicking Add for a new child node, i can enter my details and update the row. 

In the example shown here: https://demos.telerik.com/aspnet-mvc/treelist/editing you'll see once the update button is clicked the row automatically updates and you can see the child node you've created.

My issue is that once i click the update button the row disappears and only a page refresh will show the new child node row.

The error i get when trying to update the row is a generic: POST http://localhost:16922/Rackhouses/RackhouseTreeList_Add 500 (Internal Server Error)

Here's my cshtml for the treelist:


@(Html.Kendo().TreeList<WhiskeySystems.ViewModels.RackhouseTreeListItemVM>
    ()
    .Name("treelist")
    .Toolbar(toolbar => toolbar.Create().Text("Add Rackhouse"))
    .Columns(columns =>
    {
        columns.Add().Field(e => e.Name).Title("Name").Width(220);
        columns.Add().Field(e => e.InMyBond).Title("In My Bond").Width(100).Template("<input type='checkbox' data-bind='checked: InMyBond' onclick='return false;'/>" );
        columns.Add().Field(e=> e.Tiers).Title("Tiers");
        columns.Add().Field(e => e.Rows).Title("Rows");
        columns.Add().Field(e => e.Capacity).Title("Capacity");
        columns.Add().Width(300).Command(c =>
        {
            c.Edit();
            c.Destroy();
            c.CreateChild().Text("Add Zone");
            c.Custom().Name("defaultZone").ClassName("zoneDefault").Click("setDefaultZone").Text("Set Default");
        });
    })
    .Editable(e=>e.Mode("inline"))
    .DataSource(dataSource => dataSource
    .Create(create => create.Action("RackhouseTreeList_Add", "Rackhouses"))
    .Read(read => read.Action("RackhouseTreeList_Read", "Rackhouses"))
    .Update(update => update.Action("RackhouseTreeList_Update", "Rackhouses"))
    .Destroy(delete => delete.Action("RackhouseTreeList_Delete", "Rackhouses"))
    .Events(e=> { e.Error("onError"); e.RequestEnd("requestEnd"); })
    .Model(m => {
        m.Id(f => f.Id);
        m.ParentId(f => f.ParentId);
        m.Expanded(true);
        m.Field(f => f.Capacity);
        m.Field(f => f.DistilleryId);
        m.Field(f => f.InMyBond);
        m.Field(f => f.InvTypeId);
        m.Field(f => f.Name);
        m.Field(f => f.Rows);
        m.Field(f => f.Tiers);
    })

    )
    .Events(e => { e.DataBound("OnDataBound"); e.Edit("OnEdit"); })

    )


Heres my TreeList Add code for the controller:

 


public JsonResult RTreeList_Add([DataSourceRequest] DataSourceRequest request, RTreeListItemVM VM)
        {
            using (var contextScope = _scope.Create())
            {
                try
                {

                    _RBS.AddRTreeListItemVM(VM);
                    contextScope.SaveChanges();
                    //Assign the new Id back to the VM after saving.
                    if (VM.ParentId.HasValue)
                    {
                        VM.Id = VM._zone.Id + 0.2m;
                    }
                    else
                    {
                        VM.Id = VM._r.Id + 0.1m;
                    }
                }
                catch (Exception ex)
                {
                    ModelState.AddModelError("Error", ex.Message);
                }

                return Json(new[] { VM }.ToTreeDataSourceResult(request, ModelState), JsonRequestBehavior.AllowGet);
            }
        }









                   

 

 

I've done quite a bit of troubleshooting and cant seem to find anything that stands out.  Made sure my scripts are running in the right order.  Im new to kendo so still trying to ramp up my knowledge here.  Thanks in advance!

 

                   
Eyup
Telerik team
 answered on 26 Jan 2023
1 answer
227 views

Hi, we're testing new upgrade versiĆ³n from 2016 to 2022.

When i run debug in VS everything works fine, all component are loaded and works fine.

When i publish project in VS and deploy in our developtment IIS components like Grid and Treelist doesnt display.

I get this errors :

Uncaught ReferenceError: InitFilterTreeList is not defined
Uncaught ReferenceError: Grid_DataSourceErrorHandler is not defined

It seems that all js files are included in bundles, and in the right order :


bundles.BundleScript("~/bundles/vendorscripts", new string[]
                {
                            "~/Scripts/Vendor/Kendo/2022.1.119/jquery.min.js",
                            "~/Scripts/modernizr-*",
                            "~/Scripts/bootstrap.js",
                            "~/Scripts/autosize.min.js",
                            "~/Scripts/respond.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.all.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/jszip.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.core.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.data.odata.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.data.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.userevents.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.draganddrop.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.sortable.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.binder.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.fx.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.view.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.button.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.color.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.popup.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.slider.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.colorpicker.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.list.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.combobox.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.calendar.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.datepicker.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.timepicker.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.datetimepicker.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.dropdownlist.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.selectable.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.listview.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.upload.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.filebrowser.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.imagebrowser.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.resizable.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.drawing.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.pdf.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.window.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.editor.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.numerictextbox.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.validator.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.editable.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.filtermenu.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.menu.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.columnmenu.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.groupable.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.autocomplete.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.filtercell.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.pager.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.reorderable.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.mobile.scroller.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.mobile.view.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.mobile.loader.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.mobile.pane.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.mobile.popover.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.mobile.shim.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.mobile.actionsheet.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.ooxml.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.excel.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.progressbar.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.columnsorter.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.grid.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.maskedtextbox.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.virtuallist.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.multiselect.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.notification.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.tabstrip.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.toolbar.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.tooltip.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.treeview.draganddrop.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.dom.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.treelist.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.treeview.min.js",
                            "~/Scripts/Vendor/Kendo/2022.1.119/kendo.aspnetmvc.min.js"
                });

We're testing migration to new version with a trial licence, does it have any limitation about it?

if not Why does it display a message like that in IIS but not in VS?

 

Thanks in advance

Mariano
Top achievements
Rank 1
Iron
 answered on 01 Apr 2022
1 answer
144 views

The default NumericTextBox widget that is being generated when InCell editing a decimal field in a TreeList widget is constrained to 2 decimal precision. I want to achieve 3 decimal place precision.  I have set the format as "{0:n3}" to force the value to be displayed as 3 decimal places, but the NumericTextBox editor is rounding to 2 decimal places.  I want to override this but have not been successful.  Is there a way to specify the default editor for a TreeList field?  For the Grid widget, we can use the DefaultEditorTemplate but no such property seems to exist for TreeList fields.  It would be great if I could simply use the editor templates found in ~/Views/Shared/EditorTemplates, but this does not appear to be the case as changes to these default editor template files is not reflected for the InCell editor.

Eyup
Telerik team
 answered on 22 Dec 2021
1 answer
319 views

Hello,

Is there any way to have a delete confirmation popup or message when the Delete button is clicked in a TreeList?

I've tried using

events.Remove("onRemove");

as shown in the Events demo.  I'm using a JavaScript confirm, but the row is still deleted when I click cancel.

Many thanks,

Richard

 

Patrick | Technical Support Engineer, Senior
Telerik team
 updated answer on 30 Sep 2021
2 answers
77 views

Good morning,

I have an issue with TreeList component (in MVC) when I add the Selectable checkbox column (as first column) : in this configuration the drag & drop doesn't work correctly. 

When I try to drag a row in another position the "after" behavior would never be applied. Only the "before" and "over" behaviors seems to work correctly. All the "after" are intended always as "before".
If I simply remove the Selectable checkbox column from the configuration, all start to works fine.

Could you kindly check or give me some tips on how to solve it?

Thanks and regards,

Annamaria
Top achievements
Rank 1
Iron
 answered on 20 Jul 2021
1 answer
110 views

Hi,

i'm trying to use server pagination (as done for grids) with TreeList component. As i saw on component documentation, the pagination is only done for client side but this, for performance problems,  is not good for us..

Is there a way to make it work for this component as done for Grid (like on this https://demos.telerik.com/aspnet-mvc/grid/serverbinding?Grid-sort=&Grid-page=4&Grid-pageSize=10&Grid-group=&Grid-filter=)

 

Many thanks

Stefano

Ivan Danchev
Telerik team
 answered on 18 Jun 2021
1 answer
111 views

Hello

I am trying to use Rowtemplate on a Treelist so that we can completely control how the row is rendered, however once i have my Treelist up and running with a Rowtemplate then all the editing functionality disappears.

The cell editing works perfectly when no RowTemplateId is specified and as soon as i enable my custom Rowtemplate the editing stops working immediately, i even try manually calling edit on a cell, however no editing seems to work once i start using the custom RowTemplate.

But all the rest of the RowTemplate functionality is working, so is RowTemplates only for displaying elements right now or is it a bug?

 

Cheers

Uffe

Ivan Danchev
Telerik team
 answered on 15 Jun 2021
1 answer
385 views

I am using the kendo dropdown tree with vuejs. Below is how I am using the dropwdowntree.

The "mySelectedList" contains an array of IDs. If the form is being edited and the array is populated, this array will check items on the dropdowntree. This is as expected.

But as items from the dropdowntree are checked or unchecked by the user, this array "mySelectedList" does not get updated.

What is the proper way to bind a property to the dropdowntree?  How do I get "mySelectedList" to get updated as the user checks or unchecks items in the dropdowntree?

 

<dropdowntree 

:data-source="myDataSource"
autoClose: false
:checkboxes="true"
:check-all="true"
:placeholder="'Select from tree'"
dataTextField="text"
dataValueField="id"
v-model="mySelectedList"
>
</dropdowntree>

 

Petar
Telerik team
 answered on 27 May 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?