This is a migrated thread and some comments may be shown as answers.

MVC treeview with horizontal checkboxes

1 Answer 159 Views
Checkbox
This is a migrated thread and some comments may be shown as answers.
Donna
Top achievements
Rank 1
Donna asked on 19 Nov 2020, 11:31 PM

Here is my treeview. How do I format the checkboxes horizontal instead of vertical?

  @(Html.Kendo().TreeView()
                    .Name("treeview")
                    .Checkboxes(checkboxes => checkboxes
                        .Name("checkedFiles")
                        .CheckChildren(true)
                    )
                    //Inline data is set with the BindTo method
                    .BindTo((IEnumerable<ndpbrn_hub.Areas.PaymentTracking.Models.ViewModels.NodeChkBox>)ViewBag.inline, (NavigationBindingFactory<TreeViewItem> mappings) =>
                    {
                        mappings.For<ndpbrn_hub.Areas.PaymentTracking.Models.ViewModels.NodeChkBox>(binding => binding.ItemDataBound((item, category) =>
                        {
                            item.Id = category.NodeID;
                            item.Text = category.NodeName;
                            item.Checked = category.IsSelected;
                        })

                      );
                    })
    )

1 Answer, 1 is accepted

Sort by
0
Stoyan
Telerik team
answered on 20 Nov 2020, 01:41 PM

Hello, Donna,
thank you for your question.

With the current implementation of the TreeView, it renders the hierarchical data and the checkboxes for the separate nodes vertically. Currently, the Treeview API does not expose a configuration option that would allow you to achieve the desired result to render the TreeView nodes and their checkboxes horizontally.

What I can suggest if you'd like to see such an option available is to log a Feature Request in our Feedback portal. If you decide to do so please share as many details as possible on the scenario and requirements as this will help us assess better the request. We will then monitor the community interest in such a feature and consider it for implementation in a future release.

Regards,
Stoyan
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Checkbox
Asked by
Donna
Top achievements
Rank 1
Answers by
Stoyan
Telerik team
Share this question
or