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

My requirements say that I must sort the items in the treelist alphabetically.  This includes the child nodes.  This control uses a "flat hierarchy" because it is a table with parent references.  When I sort the source data alphabetically it doesn't seem to change anything.  I need to short by Group.Name:

<script id="icon-template" type="text/x-kendo-template">
    <div class='group-icon'
         style='background-image: url(@Url.Content("#: ImageUrl #"));'></div>
    <div class='group-name'>#: Name #</div>
</script>
 
@(Html.Kendo().TreeList<Group>()
    .Name("treelist")
    .Columns(columns =>
    {
        if (!Model.GetBoolValue(Glossary.Models.Group.Keys.IsHideDetails))
        {
            columns.Add().Command(c => { c.Custom().Text("Details").Name("detailButton").ClassName("detailButton").Click("goDetail"); }).Width(Glossary.Portal.ButtonWidth);
        }
 
        if (Model.GetBoolValue(Glossary.Models.Group.Keys.IsHideMeta))
        {
            columns.Add().Field(e => e.Name).TemplateId("icon-template").Width(225);
        }
        else
        {
            columns.Add().Field(e => e.Name).TemplateId("icon-template");
        }
    })
    .DataSource(dataSource => dataSource
        .ServerOperation(false)
        .Read(read => read.Action("IndexJson", "Groups").Data("getData"))
        .Model(m =>
        {
            m.Id(f => f.Id);
            m.ParentId(f => f.ParentId);
            m.Expanded(true);
            m.Field(f => f.Name);
        }).Events(events => events.Error("onError"))
      ).Events(evt => evt.DataBound("treeListBound"))
)

 

 

Alex Hajigeorgieva
Telerik team
 answered on 02 Apr 2020
1 answer
3.3K+ views

Hi, I have an index page that I'm trying to implement a simple kendo grid

I have followed the instructions closely here: 

https://docs.telerik.com/aspnet-core/getting-started/getting-started

However I keep getting a problem of 'uncaught referenceerror kendo is not defined' on the client-side js

I have attached the relevant files.

 

Thanks in advance

 

 

 

Ivan Danchev
Telerik team
 answered on 01 Apr 2020
9 answers
1.6K+ views

Currently I have a grid that groups on a specific column of the data. The display looks just as desired. A template is used to display the grouping "header" like

.ClientGroupHeaderTemplate("Title: #= ...  # <br/>Description: #=... # <br/>Author: #= ... # <span class='badge badge-light'>#= ... #/#= ...  #</span>");I 

 

The problem is that when exporting to Excel this "header" along with the associated HTML is exported as well. I would like to somehow disable these extra header lines from appearing in the exported data? As an added bonus I would also like to remove the duplicates from the exported data.

 

Thank you.

 

Michael
Top achievements
Rank 1
 answered on 01 Apr 2020
3 answers
173 views

I posted this in another thread (https://www.telerik.com/forums/how-to-disable-a-dropdownlist-in-a-row-when-another-dropdownlist-chooses-a-value) if you need more background but this is a new issue I've encountered so it deserves it's own thread in case someone else runs into it.

I have a grid very similar to the one in this example where I am using 3 different client templates to populate and bind 3 drop downs in my grid:
https://demos.telerik.com/aspnet-core/grid/editing-custom

My dropdowns are:
Category
Department
Configuration

I got this all working perfectly but then the client wanted to make Department an editable dropdown (either choose an option, or add a new one on the fly) so I converted the Department dropdownlist to a combobox

I then wrote an ajax call to add the new item to the database:

//e is the Department combobox
function addDepartment(e) {
       var dept = new Object();
       dept.DepartmentID = 0;
       dept.DepartmentName = e.text();
  
       $.ajax(
       {
           url: '@Url.Action("AddDepartment", "Wizard")',
           type: 'GET',
           dataType: "json",
           data: dept,
           contentType: 'application/json; charset=utf-8',
           success: function (result) {
               console.log("success");
               //re-fetch the datasource so the combo has the newly added item in it with its new PK
               this.dataSource.read();
               //I tried forcing its selection like this but it didn't help
                  e.value(result.DepartmentID);
           }
           })
         console.log("dept added");
   }

 

Everything work the way it should, the record is saved to the db, the combobox has the newly added item selected but when you go to save the row, that newly added Department is not actually selected (you get an empty object posted to Controller). HOWEVER, if you first select another option from the Department combo then re-select the newly added item it 'sets' the state correctly to the new object and it gets posted to the Controller correctly. You can see in my script above I'm trying to force it to set the combo but that didn't work. Any ideas how to work around this?

 

 

 

Nikolay
Telerik team
 answered on 01 Apr 2020
1 answer
118 views
when i select a row in grid. it fire change event, but I re-select the same row. the change event fire too. how can i prevent the change event when i select the same row?
Nikolay
Telerik team
 answered on 01 Apr 2020
2 answers
204 views

When I make a TreeList selectable, how do I capture a click and double-click event with information about the selected Item?  

 

Thanks, Joel

Nikolay
Telerik team
 answered on 31 Mar 2020
2 answers
173 views

 

Using ASP.NET Core 3.1 Razor Pages

 

Page Model:

        public IList<Label> Label { get;set; }

        public async Task OnGetAsync()
        {

            Label = await _context.Labels
                .ToListAsync();

       }

Page: This renders no output at all on the Razor page even though debugging shows records in Model.Label.

I've also noticed that the standard table bound to the same data will work until this code is added to the page, it then also renders nothing. Other controls work fine.

@(

    Html.Kendo().Grid(Model.Label)
    .Name("label-grid")
    .Columns(columns =>
    {
        columns.Bound(c => c.ProductId).Title("Item");
        columns.Bound(c => c.Template);
        columns.Bound(c => c.Family);
        columns.Bound(c => c.ProductLine);
        columns.Bound(c => c.EdgeDetail);
        columns.Bound(c => c.GridSize);
        columns.Bound(c => c.Size);
    })

)

Mark
Top achievements
Rank 1
 answered on 27 Mar 2020
2 answers
173 views

Hello,

I'm currentlty migrating a project to net core 3.1 and I have an issue with the ForeignKey column into a grid. Everything is fine with an another net version.

The issue is that if I try to have a ForeignKey column with a guid proprerty is not working properly, the dropdown is correctly populated so I can select the value I want but after the selection the cell is empty, the selected value has been successfuly sent to the server and if I try to display the grid items into the console the value is correct too but nothing is displayed.

And if I try to switch the type of the property from GUID to string, it's working.

The DataFieldValue and the DataFieldText are correct too.

Any ideas?

Thanks.

 

Pierre
Top achievements
Rank 1
 answered on 27 Mar 2020
8 answers
1.9K+ views

I have a grid very similar to the one in this example where I am using 3 different client templates to populate and bind 3 drop downs in my grid:

https://demos.telerik.com/aspnet-core/grid/editing-custom

My dropdowns are:

  • Category
  • Department
  • Configuration

I have a business rule whereby if the user chooses one particular category then I need to set the Configuration drop down to it's first selection (which is 'NONE') and disable it so that the user is unable to change it. If the user chooses any other category, I need to re-enable that Configuration dropdown so that they can make a choice. How do I tackle this? 

Nikolay
Telerik team
 answered on 27 Mar 2020
1 answer
274 views
Is there a way to read a barcode from image in .net core?
Tsvetomir
Telerik team
 answered on 27 Mar 2020
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?