Telerik Forums
UI for ASP.NET Core Forum
2 answers
173 views

I'm trying to select which tab is active when the screen is loaded Here's the code I'm using but it doesn't work. Neither tab is selected when the tab strip is loaded.

<div class="col-sm-offset-3 col-md-offset-3">
    @(Html.Kendo().TabStrip()
    .Name("tabstrip")
    .TabPosition(TabStripTabPosition.Top)
    .Collapsible(true)
    .Navigatable(false)
    .Animation(animation =>
    {
        animation.Open(config =>
        {
            config.Fade(FadeDirection.In);
        });
    })
    .Items(items =>
    {
        items.Add().Text("Contact").LoadContentFrom("EditContact", "People", new { id = Model.person.Id }).Selected("@Model.tab" == "Contact");
        items.Add().Text("Address").LoadContentFrom("EditAddress", "People", new { id = Model.person.Id }).Selected("@Model.tab" == "Address");
    })
    .Events(e => e.Activate("onActivate"))
    )
</div>

Tom
Top achievements
Rank 1
 answered on 12 Dec 2019
1 answer
391 views

What's the syntax for this as this doesn't seem to work?

 

 <editable enabled="true" mode="popup" template="/Features/Shared/EditorTemplates/FileUploadForm.cshtml" />

Nikolay
Telerik team
 answered on 11 Dec 2019
3 answers
113 views

I am using an editor to save pieces of text in an application. With that editor i have a save and cancel button. When pressing the cancel button it checks for any changes between the editor and the loaded in value (this value is stored in an hidden input, gathered from the database). 

When I insert an image using the ImageBrowserController with the editor, it automatically adds the alt="" text to the image tag. In Chrome this tag is always placed at the end of the image tag, however in IE11 it seems that when using the editor, the tag is placed in the front of the image tag. This causes the two values to not be identical. It means that the loaded value has the alt text on the left but the editor the alt text is on the right of the image tag.

Is this a bug or is there something I can do about this?

 

In summary:

IE11 changes the way the image tag is loaded in the editor compared to Chrome. In Chrome the alt attribute is placed after the source and in IE11 it's placed before the source. When I save a piece of text with an image in Chrome and then open it in IE11 and press Cancel, it detects it as a change, even though I didn't change anything myself.

Veselin Tsvetanov
Telerik team
 answered on 10 Dec 2019
6 answers
123 views
I`m working with your new filter, but I have a problem. When I use EditorTemplateHandler and making dropdown for current column and I persist state and when I load data I lost values from dropdown. For instance if I have dropdown with dataTextField string and dataValueField string, after load my dropdown become input. Is it a normal behavior?
Viktor Tachev
Telerik team
 answered on 10 Dec 2019
3 answers
1.4K+ views

Hi All,

I'm trying out https://demos.telerik.com/aspnet-mvc/grid/toolbar-template on my razor page

but I'm getting error "Cannot convert lambda expression to type 'string' because it is not a delegate type" when using @<text>

if I change the @<text></text> to "" it works but adding  @(Html.Kendo().DropDownList() ..... shows as text only.

toolbar.ClientTemplate(@<text>
<div class='toolbar'>
  <label class='category-label' for='category'>Show products by category:</label>
</div>
</text>);
Petar
Telerik team
 answered on 10 Dec 2019
1 answer
192 views

Hi,

How do I put the renderbody function inside a splitter pane?

Thanks ... .Ed

 

Ivan Danchev
Telerik team
 answered on 10 Dec 2019
4 answers
67 views

Hello,

I have one parent grid and one child grid for each row of the parent grid. The parent has one model <NewVoucherViewModel> and the grid has other model <LineItemsViewModel>. The parent contents a property LineItems wich is a list of objects of type LineItemsViewModel.

I will only have one button on the row of the parent grid for saving. I want that when the user clicks this button, will fill automatically all properties of the parent <NewVoucherViewModel> and i would manually fill the LineItems property of the model. After that i want to save the changes.

However it looks like it goes in a loop because of the saveRow() method at the end triggers again the save Event? How can i manage this? What is the best approach? How can i save all at the end? 

This is how my code looks like:

<script>
    function saveEvent(e) {
        //e.preventDefault();
        //var row = e.sender.select();
        //var parentGrid = $("#grid5").data("kendoGrid");
        var childGridName = "#grid5_" + e.model.VoucherId;
        var grid = $(childGridName).data("kendoGrid");
        var childGridItems = [];
        //var allRows = grid.items();
 
        var totalrecords = grid.dataSource.total();
        console.log(totalrecords);
        for (var i=0 ; i <= grid.dataSource.total(); i++) {
            var dataItem = grid.dataItem("tbody tr:eq(" + i + ")");
            var dataArray = {
                "Account": dataItem.Account,
                "Assignment": dataItem.Assignment,
                "CostCenter": dataItem.CostCenter,
                "GrossAmount": dataItem.GrossAmount,
                "GsCode": dataItem.GsCode,
                "InternalOrder": dataItem.InternalOrder,
                "ItemText": dataItem.ItemText,
                "Lc2amount": dataItem.Lc2amount,
                "LcAmount": dataItem.LcAmount,
                "Platform": dataItem.Platform,
                "PmtBlock": dataItem.PmtBlock,
                "PostingKey": dataItem.PostingKey,
                "TaxCode": dataItem.TaxCode,
                 "TaxKey": dataItem.TaxKey,
                "TransactionType": dataItem.TransactionType,
                "VoucherId": dataItem.VoucherId,
                "WbsElement": dataItem.WbsElement,
            };
            childGridItems.push(dataArray);
        }
 
        e.model.LineItems = childGridItems;
        //console.log(row);
 
        //console.log(e.model);
        e.sender.saveRow();
         
    }
 
    //function showDetails(e) {
            //alert("details");
       // }
</script>
<div class="modal-body">
    @(Html.Kendo().Grid<NewVoucherViewModel>()
    .Name("grid5")
    .Columns(columns =>
    {
        columns.Bound(p => p.IcType);
        columns.Bound(p => p.IcSide);
        columns.Bound(p => p.ApprovalType);
        columns.Bound(p => p.IcFlow);
        columns.Bound(p => p.ChargingEntityArProfitCenter);
        columns.Bound(p => p.ChargingEntityArCompanyCode);
        columns.Bound(p => p.ChargingEntityArPartnerProfitCenter);
        columns.Bound(p => p.ChargingEntityApProfitCenter);
        columns.Bound(p => p.ChargingEntityApCompanyCode);
        columns.Bound(p => p.ChargingEntityApPartnerProfitCenter);
        columns.Bound(p => p.Comment);
        columns.Bound(p => p.HeaderText);
        columns.Bound(p => p.RecurringFrom);
        columns.Bound(p => p.RecurringTo);
        columns.Command(command => { command.Edit(); command.Destroy(); command.Custom("Save Changes").Click("saveEvent"); });
    })
    .ToolBar(toolbar => toolbar.Create())
    .Editable(editable => editable.Mode(GridEditMode.InLine))
    .Pageable()
    .Sortable()
    .Scrollable()
    .Events(events => events
            .Save("saveEvent")
    )
    .ClientDetailTemplateId("template")
    .HtmlAttributes(new { style = "height:800px;font-size:12px;" })
    .DataSource(dataSource => dataSource
        .Ajax()
        .PageSize(20)
        .Model(model => model.Id(p => p.VoucherId))
        .Create(update => update.Action("EditingInline_Create", "Grid"))
        .Read(read => read.Action("Voucher_Data_Read", "Actions"))
       )
    )
 
    <script id="template" type="text/kendo-tmpl">
        @(Html.Kendo().Grid<LineItemsViewModel>()
                .Name("grid5_#=VoucherId#")
                .Columns(columns =>
                {
                     columns.Bound(p => p.PostingKey);
                     columns.Bound(p => p.Account);
                     columns.Bound(p => p.GrossAmount);
                     columns.Bound(p => p.ItemText);
                     columns.Bound(p => p.TaxCode);
                     columns.Bound(p => p.CostCenter);
                     columns.Bound(p => p.Platform);
                     columns.Bound(p => p.WbsElement);
                     columns.Bound(p => p.TransactionType);
                     columns.Bound(p => p.Assignment);
                     columns.Bound(p => p.TaxKey);
                     columns.Bound(p => p.LcAmount);
                     columns.Bound(p => p.Lc2amount);
                     columns.Bound(p => p.PmtBlock);
                     columns.Bound(p => p.GsCode);
                     columns.Command(command => { command.Destroy(); });
                })
                .ToolBar(toolbar => toolbar.Create())
                .Editable(editable => editable.Mode(GridEditMode.InLine))
                .HtmlAttributes(new { style = "height:800px;font-size:12px;" })
                .DataSource(dataSource => dataSource
                    .Ajax()
                    .PageSize(10)
                    .Model(model => model.Id(p => p.VoucherId))
                    )
                .Pageable()
                .Sortable()
                .ToClientTemplate()
        )
    </script>
    <script>
        function dataBound() {
            this.expandRow(this.tbody.find("tr.k-master-row").first());
        }
    </script>
Georgi
Telerik team
 answered on 10 Dec 2019
3 answers
798 views
Hello,

we want to add a Grid with taghelpers to our razor-pages application.

One Column should be editable (incell) as a Combobox.
Another Column should be should editable as a MultiSelect(Combobox).

Unfortunatelly I could not find any documentation on how to add something like that with taghelpers.

It would be appreciated if you could give me an example on how to do that.

Best regards,

Lars
Georgi
Telerik team
 answered on 10 Dec 2019
1 answer
104 views

Hello,

I'm trying to open a popup editor for a grid that resides inside a kendoWindow.  I can open the window and display the grid.  I can also have an "Add New" button on the grid's toolbar that works, and adds new content to the grid, however, the edit and delete buttons on each row of the grid are not clickable (nothing happens when I click them).

My grid resides inside <div> tags that I open as a kendoWindow via a JavaScript function.

function Create_Options() {
    var wnd = $("#dlgProjectOption").kendoWindow({
        title: "Add/Edit Option(s)",
        modal: true,
        visible: false,
        width: 600,
        height: 600
    }).data("kendoWindow");
 
    wnd.center().open();
}

 

Here's my grid markup:

@(Html.Kendo().Grid<OptionsCountermeasureViewModel>()
        .Name("OptCountermeasure")
        .Columns(columns =>
        {
            columns.Command(command =>
            {
                command.Edit().Text(" ");
                command.Custom(" ").Text("").Click("openRemoveWindow").IconClass("k-icon k-i-close");
            }
            ).Width(120).MinResizableWidth(49).HtmlAttributes(new { style = "text-align: center;" });
            columns.Bound(c => c.CountermeasureType).Title("Type");
            columns.Bound(c => c.Description);
        })
        .HtmlAttributes(new { style = "height: 300px; width: 100%;" })
        .Scrollable(s => s.Height("auto"))
        .Resizable(resize => resize.Columns(false))
        .Groupable(false)
        .Sortable(true)
        .ToolBar(toolbar =>
        {
            toolbar.ClientTemplateId("GridToolbarTemplateOpt");
        })
        .Editable(editable => { editable.Mode(GridEditMode.InLine); }) //.TemplateName("_OptionsCountermeasureCreate").DisplayDeleteConfirmation(false); })*/
        .Events(e =>
        {
    e.Edit("grdCountermeasure_OnEdit");
    e.Save("grdCountermeasure_OnSave");
})
        .DataSource(datasource => datasource
            .Ajax()
            .PageSize(50)
            .Events(events =>
            {
    events.Error("error_handler");
    events.RequestEnd("Countermeasure_onRequestEnd");
})
            .Model(model =>
            {
    model.Id(m => m.CountermeasureId);
    model.Field(f => f.CountermeasureTypeId).Editable(true);
    model.Field(f => f.Description);
})
            .ServerOperation(false)
            .Read(read => read.Action("GetOptionCountermeasures", "RRManagement").Data("GetOptionId"))
            .Update(update => update.Action("UpdateCountermeasures", "RRManagement"))
            .Create(create => create.Action("CreateCountermeasures", "RRManagement"))
            .Destroy(destroy => destroy.Action("DeleteCountermeasures", "RRManagement"))
    ))

Why won't the edit/delete command of a kendo Grid buttons work inside the kendoWindow?

Any help is appreciated.  Thanks.

Shawn A.

 

 

Shawn
Top achievements
Rank 1
 answered on 09 Dec 2019
1 answer
138 views

Grid content shown as undefined all the cells of the grid after upgrade to .Net core 3.0.

I can see the data sent properly from Controller Action, Please see the attached document.

I was required to change my controller action (as part of .Net core 3.0 upgrade)From: return Json(datatable..ToDataSourceResult(request)); To: return Json(datatable.AsEnumerable().ToDataSourceResult(request));

 

 

Nikolay
Telerik team
 answered on 09 Dec 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?