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

Hi,

I am looking for a way where in I can achieve the following.

1. Load tree with nodes and some nodes selected and expanded. (Typically a edit screen where in some nodes are selected and saved to database)

2. I would like to Bind custom properties as well.

 

For achieving 1 I used .ItemDataBound event. But for 2 I can use DataSource. If I use datasource I can bind custom properties but not able to set Expanded, Selected, Checked properties.

 

Is there a way I can achieve both? or I am making some mistakes in my approach.

Ultimately I need to be able to retrieve all the selected nodes. Please guide me to links/examples/posts if you have any.

 

Veselin Tsvetanov
Telerik team
 answered on 19 Feb 2019
1 answer
156 views

I have a request to add and remove some fields in the appointment details. Can I do that? How can I achieve this? I'm attaching a print screen of what I'm trying to customize.

Thank you.

Dimitar
Telerik team
 answered on 18 Feb 2019
4 answers
90 views

I'm using the "Basic usage" spreadsheet example as the start to my code. When I set .Sheetsbar(false) the scroll bars are disabled. I would like to hide the sheetsbar but keep the scroll bars enabled. How is this done?

Mark
Top achievements
Rank 1
 answered on 15 Feb 2019
1 answer
232 views

I've created a spreadsheet in a View that is somewhat complex. The first 10 rows are frozen and function as an informational header to the data which is in rows 11 and greater. The header has merged cells and labels for data. For example, it's a time card spreadsheet and row 1 has just the employee name with the label for the name just to the left of it. I am assuming I can't use a datasource because the spreadsheet is not a simple column/row display of data. What is the best practice to load a spreadsheet like this with data read from the database?

Marin Bratanov
Telerik team
 answered on 15 Feb 2019
1 answer
174 views

I use Entity Framework Core 2.2.  It does me a solid by constructing the entire hierarchy from the database without me asking it to.  That said, your TreeList actually binds to a Flat structure.  Your model definition then defines how the hierarchy is built.

Do you have an example of how you use EF with your TreeList?  Do you have tools or a method that I could use to convert what I get from EF over to what your control needs?

I have a self-referencing Group table:

  • Id
  • ParentId
  • Name
  • Description

ParentId references Id

@(Html.Kendo().TreeList<GsiPortal.Models.Group>()
    .Name("treelist")
    .Columns(columns =>
    {
        columns.Add().Command(c => { c.Custom().Text("Details").Name("detailButton").Click("toDetails"); }).Width(120);
        columns.Add().Field(e => e.Name).Width(220).TemplateId("icon-template");
        columns.Add().Field(e => e.Description).Width(220);
        columns.Add().Command(c => { c.Custom().Text("Create").Name("createButton").Click("toCreate"); }).Width(120);
    })
    .Selectable(selectable => selectable.Mode(TreeListSelectionMode.Single))
    .DataSource(dataSource => dataSource
        .ServerOperation(false)
        .Read(read => read.Action("IndexJson", "Groups").Data("readParams"))
        .Model(m =>
        {
            m.Id(f => f.Id);
            m.ParentId(f => f.ParentId);
            m.Expanded(true);
            m.Field(f => f.Name);
            m.Field(f => f.Description);
        }
    )
    .Events(events =>
    {
        events.Error("onError");
    })
    ))
 
    <script>
        var groupId = Number(@(ViewBag.GroupId));
 
        function readParams() {
            return { id: groupId };
        }
 
        function toDetails(e) {
            e.preventDefault();
            var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
 
            if (dataItem != null) {
                window.location.href = '@Url.Action("Details", "Groups")/' + dataItem.Id;
            }
        }
 
        function toCreate(e) {
            e.preventDefault();
            var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
 
            if (dataItem != null) {
                window.location.href = '@Url.Action("Create", "Groups")/?parentId=' + dataItem.Id;
            }
        }
 
        function onError(e) {
            alert(e.toString());
        }
 
 
    </script>
Preslav
Telerik team
 answered on 15 Feb 2019
1 answer
130 views

I have the following grid.  However, I was given the requirement that we shouldn't have the search exposed full time.  We should only display it when we have more than 1 page worth of data.  How do I accomplish this?

@using Portal.Configuration
@using Portal.Models
 
@{
    ViewData["Title"] = "Customers";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
 
<h2>Customers</h2>
 
<p>
    <a asp-action="Create">Create New</a>
</p>
<div class="row">
    <div class="col-xs-18 col-md-12">
        @(Html.Kendo().Grid<Customer>()
                      .Name("grid")
                      .Columns(columns =>
                      {
                          columns.Command(command => command
                              .Custom("Detail")
                              .Click("goDetail"))
                              .Width(Glossary.ButtonWidth);
                          columns.Bound(p => p.Name)
                              .Filterable(ftb => ftb.Cell(cell => cell.Operator("contains")
                                  .ShowOperators(false)
                                  .SuggestionOperator(FilterType.Contains)));
                          columns.Bound(p => p.ProfileId)
                              .Filterable(ftb => ftb.Cell(cell => cell.Operator("contains")
                                  .ShowOperators(false)
                                  .SuggestionOperator(FilterType.Contains)));
                          columns.Bound(p => p.DatabaseStatus.Name).Title("Database Status")
                              .Filterable(ftb => ftb.Cell(cell => cell.Operator("contains")
                                  .ShowOperators(false)
                                  .SuggestionOperator(FilterType.Contains)));
                          columns.Bound(p => p.AddTimestamp).Format("{0:MM/dd/yyyy}");
                      })
                      .Pageable()
                      .Sortable()
                      .Scrollable()
                      .Filterable(ftb => ftb.Mode(GridFilterMode.Row))
                      .HtmlAttributes(new { style = "height:550px;" })
                      .DataSource(dataSource => dataSource
                          .Ajax()
                          .PageSize(20)
                          .Read(read => read.Action("IndexJson", "Customers"))
                      )
        )
 
        <script type="text/javascript">
 
            function goDetail(e) {
                e.preventDefault();
                var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
                window.location.href = '@Url.Action("Details", "Customers")/' + dataItem.Id;
            }
 
            function error_handler(e) {
                if (e.errors) {
                    var message = "Errors:\n";
                    $.each(e.errors,
                        function (key, value) {
                            if ('errors' in value) {
                                $.each(value.errors,
                                    function () {
                                        message += this + "\n";
                                    });
                            }
                        });
                    alert(message);
                }
            }
        </script>
    </div>
</div>
Georgi
Telerik team
 answered on 15 Feb 2019
2 answers
1.2K+ views

Hi,

I have a treeview and I want to bind hierarchical data. 

Country

State

Offices in State

I want to make call to the controller and get the data based on the node that is being expanded. To get the right data I want send the parameter of the currently selected node (Id, level) so that I can get the appropriate data to expand. 

 @(Html.Kendo().TreeView()
              .Name("exampleTreeView")
              .LoadOnDemand(true)
              .Checkboxes(checkboxes => checkboxes
                  .Name("checkbox")
                  .CheckChildren(true)
              )
              .Events(events => events
                  .Check("onCheck")
              )
              .DataTextField("Name")
              .DataSource(dataSource => dataSource
                  .Model(model=>model.Id("Value").HasChildren("HasChildren"))
                  .Read(read => read.Action("GetData", "MyController"))
              )
              )

Right now I can get the first set of data from getdata method and bind it. want to expand a nde which will call the same action method with some additional data to get the right data. 

I have two questions - 

1. (How) can I attach or bind additional property (level which could be country,state or office)

2. How can I pass this value to the GetData Action to get the right data.

Abinash
Top achievements
Rank 1
 answered on 14 Feb 2019
1 answer
588 views

 Does combobox/dropdowns come with client side filtering built in?  Should one use comboboxes and not dropdowns for this?

Thnks.

Marin Bratanov
Telerik team
 answered on 14 Feb 2019
1 answer
120 views

Am considering use of server side filtering and paging for combobox because expecting large number of dropdown values.

What would be  the recommended number of values count for which the use of server side filering/paging is recommended?  When would one start seeing performance issues with large number of dropdown values?

Thnks.

Marin Bratanov
Telerik team
 answered on 14 Feb 2019
2 answers
54 views

Your link returns a "not found" error:

 

https://demos.telerik.com/aspnet-core/tabstrip/events

 

Alex Hajigeorgieva
Telerik team
 answered on 14 Feb 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
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
Iron
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?