Telerik Forums
UI for ASP.NET Core Forum
3 answers
181 views
I have been trying to find a way to only show one row detail expanded at a time.  I found some code in Kendo UI for jquery but it does not see to work.  Does anyone have any idea what I am doing wrong?
var lastContactId;
    function onShowDetail(e) {
        lastContactId = e.sender.dataItem(e.masterRow).ContactId;
 
        // collapse all but current
        var currentRow = e.masterRow;
        var grid = $('#grid_client_contact').data('kendoGrid');
        var masterRows = grid.table.find('tr.k-master-row');
        console.log(masterRows);
        var mappedRows = $.map(masterRows, function (row, rowIndex) {
 
            if ($(row).find("a.k-minus").length > 0 && !$(row).is(currentRow)) {
                console.log(row);
                return $(row);
            }
            return null;
        });
        console.log(mappedRows.length);
        for (var i = 0; i < mappedRows.length; i++) {
            grid.collapseRow(mappedRows[i]);
            console.log(i);
        }
    }
Carlos
Top achievements
Rank 1
 answered on 10 Nov 2020
1 answer
247 views

Hello,

I am developing a wizard very similar to the one you provide in this demo: https://demos.telerik.com/aspnet-core/wizard/index . I wonder if you could help me to find out how to send the model back to the controller after clicking on done. Do you have to send the data with ajax or can you send the model back to the controller? Sorry if this question is too obvious, I am just starting.

Kind Regards,

Pablo

Marconi
Top achievements
Rank 1
Veteran
 answered on 08 Nov 2020
1 answer
366 views

Hello,

I am developing a ASP.NET core Telerik Wizard prototype, each step is a form. The issue is that I have a submit button for the form and next button for the wizard so the user has to click on submit and then on next to continue. I would like to submit the form when the user clicks on the next button. Is it possible? If I cannot submit the form with the next button I will have to bin the prototype. 

Kind Regards.

Marconi
Top achievements
Rank 1
Veteran
 answered on 08 Nov 2020
1 answer
513 views

Good morning, 

I'm new to Telerik and doing a POC evaluation using the Aspnet Core Grid control to see if it will work for our situation.  I've worked through most issues along the way, but I'm unable to get aggregates to work on the grid so far and I'm hoping it's something simple I'm missing and not a limitation of aggregates within a nested grid hierarchy. 

Here is the scenario:

I am trying to do a simple count of items in the nested grid and place them using the .ClientGroupHeaderColumnTemplate.  I'm also adding the .Aggregates to the DataSource call.  When I do so, I am unable to access the grid and get the following javascript error:  "Uncaught ReferenceError: count is not defined"

I believe I have followed all the demos/examples/threads that I've found online correctly, but the difference is that this grid is nested within 2 other grids. I have also tried several of the other ClientTemplates (footer, header, etc...) with the same result.  Thanks in advance for any help you can give and let me know if you need additional information.

Here is the code I'm calling for this grid:

<script id="agents" type="text/kendo-tmpl">
    @(Html.Kendo().Grid<TLCAgentSchedulerT.Models.AgentViewModel>
    ()
    .Name("agent_#=SubPodId#")
    .Columns(columns =>
    {

        columns.Bound(o => o.AgentName).Width(50);
        columns.Bound(o => o.Block1).Width(4)
            .ClientGroupHeaderColumnTemplate("Sum: #= count#")
            .ClientTemplate(@"<div class='agentStatus' style='background-image: url(" + @Url.Content("~/images/\\#:data.Block1\\#.png") + ");'></div>").ClientHeaderTemplate("<span data-toggle='tooltip' data-placement='top' title='6:00 AM EST'>B1</span>");
        columns.Bound(o => o.Block2).Width(4).ClientTemplate(@"<div class='agentStatus' style='background-image: url(" + @Url.Content("~/images/\\#:data.Block2\\#.png") + ");'></div>").ClientHeaderTemplate("<span data-toggle='tooltip' data-placement='top' title='6:00 AM EST'>B2</span>");
        columns.Bound(o => o.Block3).Width(4).ClientTemplate(@"<div class='agentStatus' style='background-image: url(" + @Url.Content("~/images/\\#:data.Block3\\#.png") + ");'></div>").ClientHeaderTemplate("<span data-toggle='tooltip' data-placement='top' title='6:00 AM EST'>B3</span>");
        columns.Bound(o => o.Block4).Width(4).ClientTemplate(@"<div class='agentStatus' style='background-image: url(" + @Url.Content("~/images/\\#:data.Block4\\#.png") + ");'></div>").ClientHeaderTemplate("<span data-toggle='tooltip' data-placement='top' title='6:00 AM EST'>B4</span>");
        //Add Additional Blocks

        columns.Command(command =>
        {
            command.Edit().Text("Edit Agent");
        }).Width(25);
    })
    .DataSource(dataSource => dataSource
        .Ajax()
        //.Read(read => read.Action("EditAgent", "Grid"))
        .Update(update => update.Action("EditAgent", "Grid"))
        .Events(events => events.Error("error_handler"))
        .Aggregates(aggregates =>
        {
            aggregates.Add(p => p.Block1).Count();
        })
        .Group(groups => groups.Add(p=> p.Block1))
        .PageSize(5)
        .Read(read => read.Action("GetAgents", "Grid", new { subPodId = "#=SubPodId#" }))
        )
        //.ToolBar(toolbar => toolbar.Create()) //Adds 'Add New Record' button to toolbar
        .Editable(editable => editable.Mode(GridEditMode.PopUp))
        .Scrollable()
        //.Sortable()
        .ToClientTemplate()
    )
</script>

 

 

 

 

Eyup
Telerik team
 answered on 06 Nov 2020
6 answers
1.1K+ views
I would like to know how to export all the columns (or a set) to an Excel file.  I have searched this ans it states the columns must be added as fields.  I added this with visible(false) and the same for the columns but those fields do not get exported.  The Read() method of the datasource is returning all the columns but only a select few are showing by design.
Alex Hajigeorgieva
Telerik team
 answered on 06 Nov 2020
1 answer
145 views

Hello,

 

I use Nuget AspNet.Core (2020.1.406) but "Html.Kendo().TileLayout()" is not found...

 

Thanks

Nathan

Tsvetomir
Telerik team
 answered on 06 Nov 2020
17 answers
2.3K+ views

Do you have sample code that would allow me to upload a spreadsheet and read it, looping through each row and column using built-in functions/procedures from Telerik UI for ASP.NET?

I see you have samles in: http://demos.telerik.com/aspnet-core/spreadsheet/index. None of them though show how to upload the file and read the file using Telerik UI for ASP.net. Please advise

 

 

 

Heiko
Top achievements
Rank 1
Iron
Veteran
 answered on 05 Nov 2020
6 answers
298 views

Hello,

The generation of the identifier in TagHelpers is different from HtmlHelpers. The dot is not replaced by underscore :

<input asp-for="SubModel.Name" /> generates SubModel_Name
@Html.Kendo().AutoCompleteFor(m => m.SubModel.Name) generates SubModel_Name
<kendo-autocomplete for="SubModel.Name"></kendo-autocomplete> generates SubModel.Name

 

Is there an option to replace dot with underscore in TagHelpers ?

Cordially,
Stephane.

Aaron
Top achievements
Rank 1
Veteran
 answered on 04 Nov 2020
1 answer
870 views

Hi everyone,

 

I have a page with two grids on the page and each grid has grouping.  I want to collapse the groups in both grids and also allow the user to click on the labels to expand and collapse the groups.  I am using version 2020.2.513

So what is happening is that grid 1 is collapsing as expected, but grid 2 is not collapsing at all.  What do I have wrong?

My code is below:

Grid 1

@(Html.Kendo().Grid<VwFormSubmissionMenuListActive>()
    .Name("ActiveForms")
    .Groupable()
    .Columns(columns =>
    {
        columns.Bound(p => p.FormSubmissionId).Hidden(true);
        columns.Bound(p => p.FormName).Title("Form Name").Width(200).Hidden(true);
        columns.Bound(p => p.SubjectName).Title("Subject").Width(200).MinScreenWidth(800);
        columns.Group(group => group
            .Title("Form Agreement")
            .Columns(info =>
            {
                info.Bound(x => x.AgreementRequired).Title("Required").Width(75);
                info.Bound(x => x.AgreementStatusDescription).Title("Status").Width(75);
            })
        );
        columns.Bound(p => p.AgreementStatusId).Hidden(true);
    })
    .ToolBar(toolbar =>
    {
        toolbar.Search();
    })
    .HtmlAttributes(new { style = "height:650px;" })
    .Navigatable()
    .Selectable(selectable => selectable.Mode(GridSelectionMode.Single))
    .Sortable()
    .Groupable(true)
    .Events(events => events.DataBound("collapseGroupRows_Forms"))
    .Events(ev => ev.Change("onChange"))
    .Scrollable()
    .DataSource(dataSource => dataSource
        .Ajax()
        .ServerOperation(false)
        .GroupPaging(true)
        .Events(events => events.Error("error_handler"))
        .Model(model => model.Id(p => p.FormSubmissionId))
        .Read("vwFormSubmissionMenuList_Active", "Grid", new { StudentId = -1 })
        .Group(x =>
        {
            x.Add(y => y.FormName);
        })
    )
 
)

 

Grid 2

@(Html.Kendo().Grid<VwSubjectChange>()
    .Name("SubjectChange")
    .Groupable()
    .Columns(columns =>
    {
        columns.Bound(p => p.SubjectChangeId).Hidden(true);
        columns.Bound(p => p.Timetable).Title("Timetable").Width(200).Hidden(true);
        columns.Bound(p => p.Surname).Title("Surname").Width(100);
        columns.Bound(p => p.Preferred).Title("Preferred").Width(100).MinScreenWidth(800);
        columns.Bound(p => p.Yearlevel).Title("Current Year").Width(50);
        columns.Bound(p => p.Studentnumber).Title("Student Id").Width(50);
    })
    .ToolBar(toolbar =>
    {
        toolbar.Search();
    })
    .HtmlAttributes(new { style = "height:650px;" })
    .Navigatable()
    .Selectable(selectable => selectable.Mode(GridSelectionMode.Single))
    .Sortable()
    .Groupable(true)
    .Events(events => events.DataBound("collapseGroupRows_SubjectChange"))
    .Scrollable()
    .DataSource(dataSource => dataSource
        .Ajax()
        .ServerOperation(false)
        .GroupPaging(true)
        .Events(events => events.Error("error_handler"))
        .Model(model => model.Id(p => p.SubjectChangeId))
        .Read("VwSubjectChange", "Grid", new { username = @User.Identity.Name })
        .Group(x =>
        {
            x.Add(y => y.Timetable);
            x.Add(y => y.CurrentStatus);
        })
    )
 
)

 

Javascript code:

function collapseGroupRows_SubjectChange() {
    var grid = $("#SubjectChange").data("kendoGrid");
 
    $(".k-grouping-row").each(function (e) {
        var expanded = $(this).find(".k-i-collapse").length > 0;
 
        if (expanded) {
            grid.collapseGroup(this);
        }
        else {
            grid.expandGroup(this);
        }
 
        //grid.collapseGroup(this);
    });
 
    $(".k-grouping-row").click(function () {
        var expanded = $(this).find(".k-i-collapse").length > 0;
 
        if (expanded) {
            grid.collapseGroup(this);
        }
        else {
            grid.expandGroup(this);
        }
    });
 
}
 
function collapseGroupRows_Forms() {
 
    var grid = $("#ActiveForms").data("kendoGrid");
     
    $(".k-grouping-row").each(function (e) {
        var expanded = $(this).find(".k-i-collapse").length > 0;
 
        if (expanded) {
            grid.collapseGroup(this);
        }
        else {
            grid.expandGroup(this);
        }
 
    });
 
    $(".k-grouping-row").click(function () {
        var expanded = $(this).find(".k-i-collapse").length > 0;
 
        if (expanded) {
            grid.collapseGroup(this);
        }
        else {
            grid.expandGroup(this);
        }
    });
}

 

 

 

Tsvetomir
Telerik team
 answered on 04 Nov 2020
8 answers
1.6K+ views

I want to send the token and additional data on my update call.

Something like the below, is this possible? Do i even need the token for an intranet app? If not, how do I get rid of it?

Javascript

function additionalInfo() {
        return {
            token: kendo.antiForgeryTokens(),
            whatChanged: 2
        }
    }

 

PageModel 

   public JsonResult OnPostUpdate([DataSourceRequest] DataSourceRequest request, OCHODisplayReply reply, int whatChanged) {
 
            if (reply != null && ModelState.IsValid) {
                       /...
              }
}

 

Grid method

.Update(u => u.Url("/Index/?handler=Update").Data("additionalInfo")
Anton Mironov
Telerik team
 answered on 04 Nov 2020
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?