Telerik Forums
UI for ASP.NET Core Forum
1 answer
62 views

hi

how to refresh grid and TreeView Parent Page ?

The parent page includes grid and TreeView and I want the child page that is in the new tab
Update grid and TreeView.

Also, on the child page or the new tab, by clicked on the button, a kendo window will open in iframe mode, which I want to change the grid and TreeView after clickined the save button ، be updated on the main page.

Thanks

Alexander
Telerik team
 answered on 08 Mar 2023
1 answer
152 views

I have

@(Html.Kendo().TreeView()
    .Name("treeviewAvail")

...and...

 @(Html.Kendo().ListBox()
      .Name("listboxAvail")

How can I 'have both of those so that I can drag/drop from either into another list box?  (It's not needed to go the other way.)

@(Html.Kendo().ListBox()
    .Name("listboxSelected")

 

I've seen this topic, but it does not handle what I need for TreeView too

https://www.telerik.com/forums/listbox-drag-and-drop-1557506

 

Alexander
Telerik team
 answered on 31 Jan 2023
1 answer
112 views

Hello!  I have been troubleshooting an issue with the way that the treeview places elements.  It appears to only be happening with items that contain children (and thus have an expand arrow). 

I am unsure what could be causing this, but the library seems to be putting a span with the k-icon and k-i-expand classes (which will show the expand arrow) and then nesting the rest of the treeview row inside of that span.  When I look at the demos of the same version on your site, the spans are not nested.  Also I noticed that the css class names are different, but that might be on purpose (or perhaps I am confused about something).

<!--  HTML OF TREEVIEW ROW WITH CHILDREN  -->
<li role="treeitem" class="k-item" data-uid="900b9f8a-e745-4d2f-9177-36f8f029d19a" aria-selected="false">
    <div class="k-mid">
        <span class="k-icon k-i-expand">
            <span class="k-checkbox-wrapper" role="presentation">...</span>
            <span class="k-in">...</span>
        </span>
    </div>
</li>

<!--  VERSUS HTML OF TREEVIEW ROW WITHOUT CHILDREN  -->
<li role="treeitem" class="k-item" data-uid="dfd4e997-b440-42dc-8780-061f00ed16d6" aria-selected="false">
    <div class="k-mid">
        <span class="k-checkbox-wrapper" role="presentation">...</span>
        <span class="k-in">...</span>
    </div>
</li>

Honestly, I am pretty stumped on this one.. as far as what could be causing this.  I looked through the css classes in inspector and nothing stood out to me...  I *AM* using a template though, but I don't see how it could be the issue.  Here is the treeview definition as well as the template I am using:


<!-- GRID DEFINITION  -->
<div class="d-flex flex-row">
            @(Html.Kendo().TreeView()
                          .Name("TreeView")
                          .DataTextField("Name")
                          .Checkboxes(true)
                          .DragAndDrop(true)
                          .Events(events => events
                              .Select("treeview_OnSelect")
                              .Check("treeview_OnCheck")
                              .Drag("treeview_OnDrag")
                              .Drop("treeview_OnDrop"))
                          .TemplateId("treeview-template")
                          .DataSource(dataSource =>
                              dataSource.Read(read =>
                                  read.Action(Model.ReadAction, Model.Controller)))
            )
</div>

<!--  TEMPLATE  -->
<script id="treeview-template" type="text/kendo-ui-template">
    # var id = item.id; #
    # if (id.includes("group")) { #
    <i class="far fa-fw fa-folder"></i>
    # } else if (id.includes("category")) { #
    <i class="far fa-fw fa-sitemap"></i>
    # } else { #
    <i class="@Model.IconClass fa-fw"></i>
    # } #
    &nbsp;
    #: item.Name #
</script>
Any help or direction on this would be greatly appreciated.
JohnD
Top achievements
Rank 1
Iron
 answered on 27 Jul 2022
1 answer
66 views
  I am unable to get the href to work in the asp .net core treeview control (Razor).   Am I doing something wrong? 

 

                           <kendo-treeview name="treeView">
                                <items>
                                    <treeview-item text=Test expanded="true">
                                        <items>           
                                            <treeview-item text="Google" href="http://www.google.com" />   
                                        </items>
                                    </treeview-item>
                                </items>
                            </kendo-treeview>

Mihaela
Telerik team
 answered on 01 Jun 2022
1 answer
76 views

Need help with presenting, creating, editing and deleting Hierarchal data using Tree view and (0r) Tree List Telerik controls for my ASP.Net Core MVC application using remote data options.

I am using Microsoft Visual Studio Community 2019 Version 16.10.3.

Example: ASP.NET Core TreeView Component Data Binding | Telerik UI for ASP.NET Core

The data is not populating by using Tree view control by using the above method using remote data option.

The below link does not have complete information about  TreeList_Read method and also data not populating for this control. 

ASP.NET MVC TreeList Component Ajax Binding | Telerik UI for ASP.NET MVC

I need help here.

Mihaela
Telerik team
 answered on 20 Dec 2021
1 answer
70 views
 The item data is not transferred via the hash syntax to the custom template ("tooltip-tamplate") for the tooltip. But it works for other templates "task-templat" and "column-template". Please help me to find out the solution. Below is my code in View:

            <!--Style progress bar-->
            <script id="task-template" type="text/x-kendo-template">
                <div class="template" style="background-color: #= Color #;">
                    <a href="#= Link #">
                        <h5 style="font-family: "Open Sans",sans-serif;">#= title #<\h5>
                    </a>
                </div>
            </script>

            <!--Style columns-->
            <script id="column-template" type="text/x-kendo-template">
                @*<i class="tio-bookmark-outlined tio-lg text-primary"></i>*@
                <span>#= ProjectGenre #</span>
            </script>

            <!--Style ToolTip-->
            <script id="tooltip-tamplate" type="text/x-kendo-template">
                <div style="padding: 1rem;">
                    <p>Genre: #= ProjectGenre # </p>
                </div>
            </script>

@(Html.Kendo().Gantt<TaskViewModel, DependencyViewModel>((IEnumerable<TaskViewModel>)ViewData["tasks"], (IEnumerable<DependencyViewModel>)ViewData["dependencies"])
                            .Name("gantt")
                            .Columns(columns =>
                            {
                                columns.Bound(c => c.Studio).Title("Студія").Width(200).Sortable(true);
                                columns.Bound(c => c.ProjectGenre).Title("Жанр").Width(300).Sortable(true).TemplateId("column-template");
                            })
                            .Views(views =>
                            {
                                views.YearView(yearView => yearView.Selected(true));
                            })
                            .ShowWorkHours(false)
                            .ShowWorkDays(false)
                            .Editable(false)
                            .Height(600)
                            .TaskTemplateId("task-template")
                            .DataSource(d => d
                                .Model(m =>
                                {
                                    m.Id(f => f.TaskID);
                                    m.ParentId(f => f.ParentID);
                                    m.Field(f => f.Expanded).DefaultValue(true);
                                    m.Field(f => f.Start).ToString();
                                    m.Field(f => f.End).ToString();
                                })
                            )
                            .Tooltip(t =>
                            {
                                t.Visible(true);
                                t.TemplateId("tooltip-tamplate");
                            })
                            .DependenciesDataSource(d => d
                                .Model(m =>
                                {
                                    m.Id(f => f.DependencyID);
                                    m.PredecessorId(f => f.PredecessorID);
                                    m.SuccessorId(f => f.SuccessorID);
                                })
                            )
                    )
Aleksandar
Telerik team
 answered on 20 Aug 2021
1 answer
205 views

I have an asp.net core razor that contains a TreeView control, populated from a List<TreeViewItemModel> .

<form id="EditEmployees">

 <div>

                  Html.Kendo().TreeView()
                        .Name("ActiveEmployees")
                        .TemplateId("treeview")
                        .BindTo((IEnumerable<TreeViewItemModel>)ViewBag.employeeList)
                        .Checkboxes(c => c.CheckChildren(true))
                        .DragAndDrop(false)
                    )

</div>

 

       <br />

        <div class="form-group form-inline row pull-right">
            <div class="col-sm-10 ">
                <button value="Save" style="margin:0 5px;" class="btn btn-navy">Save</button>
            </div>
        </div>

</form>

My issue:
When I submit the form back to the POST Action in the Controller I would like pass the checked items.
For some reason i can't see the items

Aleksandar
Telerik team
 updated answer on 09 Jun 2021
1 answer
81 views
I need to display a hierarchy with checkboxes. For this I want to use TreeView. After the hierarchy finishes loading I have to do some actions. So the TreeView is configured with LoadOnDemand: false and a function is attached to the "dataBound" event. However it seems that the data bound is called after every call to the server. Is there an event that is triggered after all the nodes have been loaded? How can I know that the databound is the last one (all the nodes have been loaded)?
Petar
Telerik team
 answered on 11 Feb 2021
1 answer
217 views

     Hi,

I have a treeview and a grid side by side on a page with bootstrap 4 layout. When the user selects a node in the treeview, the grid datasource refreshes. This works ok.

Now I'd like to size the grid and the treeview dynamically to the size of the browser window minus the header of the page, so that the treeview and the grid display a scrollbar (if needed) independently. The tree is load on demand and can contain a lot of elements.

Im struggling with setting the treeview and the grid height in the window resize handler.

Currently the grid is not paging, it maybe a requirement to have the grid paging then I would have to set the pagesize dynamically to display as much rows as possible within the available space..

Thanks for your help

 

Erwin

Martin
Telerik team
 answered on 19 Jan 2021
1 answer
190 views

Hi everybody 

I have a problem with kendo treeview checkboxes 
i populated treeview with remote data, it binds correctly. I used "checked" property to send checked checkboxes to view, it works fine too. 
i use 2 different method for sending checked node IDs to controller but does not work properly.
method1: 
use java script to read nodes recursively and gather IDs then store in hidden field and send to controller but most of the times some nodes doesn't illustrate the check items thoroughly. in other words, I lose near half of checkboxes randomly.

method2:
using checkbox name and template and send checkboxes directly to the controller got same issue. 

 

 

what can i do for this issue??
thanks

Martin
Telerik team
 answered on 19 Aug 2020
Narrow your results
Selected tags
Tags
+? more
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?