Telerik Forums
UI for ASP.NET Core Forum
3 answers
252 views
I'm having an issue with the DropDownTree (with checkboxes) when trying to display a user's saved selections.  When you render the tree with the following code taken from the example here and try to set some of the items as Checked by default, only the deepest level item is displayed in the tag list.  However, if the user checks nested items, all levels are displayed in the tag list.  You can see in the attached images the same items are selected, but the tag list is rendered differently.  Is this a bug in the DropDownTree?

@(Html.Kendo().DropDownTree()
    .Name("DropDownTree")
    .AutoClose(false)
    .Checkboxes(true)
        .Items(dropdowntree =>
        {
            dropdowntree.Add().Text("My Documents").Id("1")
                .Expanded(true)
                .Checked(true)
                .Items(root =>
                {
                    root.Add().Text("Kendo UI Project").Id("2")
                        .Expanded(true)
                        .Items(project =>
                        {
                            project.Add().Text("about.html").Id("3").Checked(true);
                            project.Add().Text("index.html").Id("4");
                            project.Add().Text("logo.png").Id("5");
                        });

                    root.Add().Text("New Web Site").Id("6")
                        .Expanded(true)
                        .Checked(true)
                        .Items(item =>
                        {
                            item.Add().Text("mockup.jpg").Id("7");
                            item.Add().Text("Research.pdf").Id("8");
                        });

                    root.Add().Text("Reports").Id("9")
                        .Expanded(true)
                        .Items(reports =>
                        {
                            reports.Add().Text("February.pdf").Id("10").Checked(true);
                            reports.Add().Text("March.pdf").Id("11").Checked(true);
                            reports.Add().Text("April.pdf").Id("12");
                        });
                });
        })
)


Dimitar
Telerik team
 answered on 04 Dec 2018
1 answer
294 views

I have a problem where if I add the "for" tag to my dropdown list my cascading stops working.

Here is the code that allows for selecting an item in the dropdown list which changes what is seen in the second dropdown list:

<kendo-dropdownlist name="Countries" class="jProfileMod" datatextfield="CountryName" datavaluefield="Id" bind-to="Model.Countries" index="1"></kendo-dropdownlist>
 
 
<kendo-dropdownlist name="DocumentTypes" for="GovIdTypeID" class="jProfileMod" datatextfield="Name" datavaluefield="Id"  bind-to="Model.GovIdTypes" cascade-from="Countries" cascade-from-field="IssuingCountry.Id"></kendo-dropdownlist>

And here I have added some code so that my model gets updated when the HTML post is called:

<kendo-dropdownlist name="Countries" for="CountryID" class="jProfileMod" datatextfield="CountryName" datavaluefield="Id" bind-to="Model.Countries" index="1"></kendo-dropdownlist>
 
<kendo-dropdownlist name="DocumentTypes" for="GovIdTypeID" class="jProfileMod" datatextfield="Name" datavaluefield="Id"  bind-to="Model.GovIdTypes" cascade-from="Countries" cascade-from-field="IssuingCountry.Id"></kendo-dropdownlist>

as soon as I do that, the fist dropdown box no longer affects the second one.

the only thing I add is: for="CountryId" in the first dropdown.

The model:

public Guid CountryID { get; set; }
public Guid GovIdTypeID { get; set; }
public List<Country> Countries { set; get; }
public List<DocumentType> GovIdTypes { set; get; }
Dimitar
Telerik team
 answered on 04 Dec 2018
3 answers
1.7K+ views

Let me know if I'm doing something wrong here.  I'm creating a Web Service to service my Web Application through a REST API.  One class of methods I'm exposing provides the view models that feed into Kendo UI controls, like the grid.  I'm trying to separate the concerns of the client and server by passing the paging parameters to the service and, when the service has completed the query and reduced the results down to a specific number of items (page size) on a given page (page #), I attempt to return the results to the client using the following:

 

            DataSourceResult dataSourceResult = investments.ToDataSourceResult<InvestmentViewModel>(dataSourceRequest);
            dataSourceResult.Total = total;
            return Json(dataSourceResult);

On the client, I attempt to deserialize this data with:

 

                //Deserializing the response recieved from web api and storing into the Employee list

                dataSourceResult = JsonConvert.DeserializeObject<DataSourceResult>(result);

 

But I get an error message:

                Newtonsoft.Json.JsonSerializationException: 'Cannot create and populate list type System.Collections.IEnumerable. Path 'data', line 1, position 9.'

What is the proper way to deserialize the DataSourceResult JSON?

 

 


Stéphane
Top achievements
Rank 1
 answered on 03 Dec 2018
1 answer
87 views

Hello,

I am using the old Jquery pie charts, these are getting populated by the model (The model will be populated by a stored procedure), however, i am trying to migrating to the new Pie chart Tag Helpers but i can not seem to use a Model as the data-source, is this possible and if so how can i achieve this?

 

Stefan
Telerik team
 answered on 30 Nov 2018
3 answers
275 views

To access item values in a template you should, as I understand it, use a construct like:

.Columns(factory => factory.Template(@<text><img title="@item.Receiver" src="/image/information.png"/></text>)

but when doing this I get the compilation error "Cannot convert lambda expression to type 'string' because it is not a delegate type".

Eyup
Telerik team
 answered on 29 Nov 2018
2 answers
820 views

Im trying to make custom editor template for inline edit mode i a .net core grid with tag helper

<kendo-grid name="grdKontaktpersoner" on-change="KontaktChange" deferred="true">
                    <datasource server-operation="false" type="DataSourceTagHelperType.Ajax" on-error="error_handler">
                        <transport>
                            <create url="/Omvisning/OpretKontakt" data="hentBestillerID" />
                            <read url="/Omvisning/HentKontakt" data="hentBestillerID" />
                            <update url="/Omvisning/OpdaterKontakt" />
                            <destroy url="/Omvisning/OpdaterKontakt" />
                        </transport>
                        <schema>
                            <model id="ID">
                                <fields>
                                    <field name="Navn" type="string" />
                                    <field name="E_Mail" type="string" />
                                    <field name="Tlfnr" type="string" />
                                    <field name="RefNr" type="string" />
                                </fields>
                            </model>
                        </schema>
                    </datasource>
                    <toolbar>
                        <toolbar-button name="create" text="Opret Kontaktperson" />
                    </toolbar>
                    <editable enabled="true" mode="inline" />
                    <scrollable enabled="false" />
                    <columns>
                        <column field="ID" hidden="true" />
                        <column field="Navn" title="Navn" editable="NavnEditor" />
                        <column field="E_Mail" title="Email"  width="200" />
                        <column field="Tlfnr" title="Telefonnr."   width="100"/>
                        <column field="RefNr" title="Ref. nr."  width="100" />
                        <column>
                            <commands>
                                <column-command name="edit" text="Ret"></column-command>
                                <column-command name="destroy" text="Slet"></column-command>
                            </commands>
                        </column>
                    </columns>
                </kendo-grid>

        function NavnEditor(container, options) {
            var grid = $('#grdKontaktpersoner').data('kendoGrid');
            $('<input required name="' + options.field + '"/>')
                .appendTo(container);
        }

the problem is that the options field in the template  is undefined

I have look at your documentation here:

https://docs.telerik.com/aspnet-core/tag-helpers/data-management/grid/overview#column-templates

what is im missing

Christian Sandöy
Top achievements
Rank 2
 answered on 29 Nov 2018
4 answers
482 views

Hello,

I have my labels formatted as 2011 9 (year month). Now I want to set that to the following:

sep 2011

I have tried the following:
.Labels(labels => labels.Format("{0:MMM yyyy}")

But this is not working. Someone that can provide me a solution for this?

Marin Bratanov
Telerik team
 answered on 27 Nov 2018
3 answers
445 views

Currently receiving the following error when attempting to implement server side sum aggregation when the grid is bound to a dynamic object.

No generic method 'Sum' on type 'System.Linq.Enumerable' is compatible with the supplied type arguments and arguments. No type arguments should be provided if the method is non-generic.

Using the following code to setup Aggregates, the col.DataType is System.Decimal. Min and Max aggregates work correctly.

.Aggregates(aggr =>
                {
                    Model.Columns.Where(x => x.SQLDataType == "money").ToList().ForEach(x =>
                    {
                        var col = Model.Columns.FirstOrDefault(c => c.ColumnName == x.ColumnName);
                        if (col != null)
                        {
                            aggr.Add(col.ColumnName, col.DataType).Sum();
                        }
                    });
                })

Konstantin Dikov
Telerik team
 answered on 26 Nov 2018
3 answers
1.3K+ views

this template does not work

<column field="Dato" title="Dato" template="#= (Dato == null) ? ' ' : kendo.toString(Dato, 'dd-MM-yyyy') #" />

t works in a html helper grid

t shows the time also

Christian Sandöy
Top achievements
Rank 2
 answered on 26 Nov 2018
1 answer
201 views

I'm using html tags and am trying to display an editor that is disabled.

<kendo-editor name="emailEditor" for="EmailSignature" />

 

I don't see disabled, enabled, contentenabled available.  How can I disable the editor? 

 

Veselin Tsvetanov
Telerik team
 answered on 26 Nov 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?