Telerik Forums
UI for ASP.NET Core Forum
1 answer
90 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
280 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
823 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
499 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
453 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.4K+ 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
205 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
1 answer
302 views

Hi Team,

I have a requirement to show the menu items as a Treeview from the database. I am able to bring the items to the without any issues. The problem I am facing here is, it's not auto-expanding by default even after the Expandall(true) function in  component. Even I tried to achieve this functionality using Javascript. But, it is not working since Javascript is executing before the . My code is,

@(Html.Kendo().TreeView()
                    .Name("treeview")
                    .DataTextField("Name")
                    .ExpandAll(true) //This expandall is not working here.
                    .DataSource(dataSource => dataSource
                        .Read(read => read
                            .Action("ReadMenuItem", "GroupWellness")
                        )
                    )
                    .Events(events=> events
                           .Select("onSelect")
                           )
         )

Java script function  //Below function is executing before the data loads in the above tree. So, it is not expanding.

$(document).ready(function () {
            $("#treeview").kendoTreeView({
                dataBound: function (e) {
                    var treeView = $('#treeview').data('kendoTreeView');
                    treeView.expand(".k-item");
                 }
            });
    });

After all this methods is not working, I thought of achieving the same treeview using kendo UI JQuery. But, there I am it is throwing 404 error while reading my URL. JQuery part is,

var dataSource = new kendo.data.HierarchicalDataSource({
           transport: {
                read: {
                    url: '/GroupWellness/ReadMenuItem', //I am facing 404 error here while reading my data source.
                    dataType: "jsonp"
                }
            }
        });

        $("#treeview").kendoTreeView({
            dataSource: dataSource
        });

Please help me to achieve Expand all functionality by default based on my requirement.

Dimitar
Telerik team
 answered on 23 Nov 2018
2 answers
219 views

This works:

@(Html.Kendo().Scheduler<Web.CoreFull.Models.Booking.m_Kalendar>()
                            .Name("calendarDag")
                            .Date(DateTime.Today)
                            .Editable(false)
                            .Height(450)
                            .Width(700)
                            .ShowWorkHours(true)
                            .Views(views =>
                            {
                                views.DayView(dayview => dayview.Selected(true));
                                views.WorkWeekView();
                                views.WeekView();
                                views.MonthView();
                                views.AgendaView();
                            })
                            .DataSource(d => d
                                .Model(m =>
                                {
                                    m.Id(f => f.ID);
                                })
                                .ServerOperation(true)
                                .Read(read => read.Action("HentKalendar", "Medarbejder").Data("getAdditionalData"))
                            )
                            .Deferred()
                    )

but this does not :

<kendo-scheduler name="calendarDag" date="@DateTime.Today" height="450" width="700" show-work-hours="true" deferred="true">
                        <views>
                            <view type="day" selected="true"></view>
                            <view type="workWeek"></view>
                            <view type="week"></view>
                            <view type="month"></view>
                            <view type="agenda"></view>
                        </views>
                        <scheduler-datasource server-operation="true" type="DataSourceTagHelperType.Ajax">
                            <transport>
                                <read url="/Medarbejder/HentKalendar" data="getAdditionalData" />
                            </transport>
                            <schema>
                                <scheduler-model id="ID" />
                            </schema>
                        </scheduler-datasource>
                        <editable enabled="false" />
                    </kendo-scheduler>

Christian Sandöy
Top achievements
Rank 2
 answered on 23 Nov 2018
1 answer
83 views

on the first treelist load, the component works as expected. however when updating the datasource "treeList.setDataSource (dsnew);" the update or insert of a new item in the treeview does not work. the popup opens, and I can fill in the fields normally, but after clicking the Update button, the popup closes as if I had sent the form information to my route, but it does not send anything. just close the popup, has anyone had this problem, or do you have any idea what might be happening?

Tsvetina
Telerik team
 answered on 22 Nov 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?