Telerik Forums
UI for ASP.NET Core Forum
4 answers
174 views

I have a controller for which the "Index" view just shows a row of data from a model collection. When the "Details" link is selected at any row, I switch to a "Details" page for the same controller with the following tabs:

General: Showing details for the selected model

Contacts: Showing address and phone data for the same model

etc.

The issue I have is that upon selecting the Contacts tab, I need to get data loaded from my model suitable for that tab and I don't know how to affect it.

I have something like this (gleaned after hours of searching:)

tabstrip.Add().Text("Contact").LoadContentFrom("EditContact", "HouseholdController", new { id = Model.Facility_Id }).Selected("@Model.tab" == "Contact");

but that doesn't do anything when I select the tab. I'm at a loss.

The HouseholdController has the following method:

        public ActionResult EditContact()
        {
            var model = db.GetWithFacility_Id(1);
            return View(model);
        }

I am grateful for any guidance. I'm a total beginner here.

Misho
Telerik team
 answered on 25 Dec 2020
1 answer
78 views

tabStrip.insertAfter({
            text: 'xxx',
            encoded: false,
            id: "xxxxxxxxx",
            content: "<iframe style='border-width:0px;height:calc(100vh - 68px);width:100%;overflow:hidden' src='"+url+"'></iframe>",
        }, tabStrip.select());

id can not be set.!!!!

 

Misho
Telerik team
 answered on 25 Dec 2020
7 answers
359 views

Hello,

Could you update your librairies to ASP.NET Core 3.0 GA (instead of 3.0 RC1) because there are some version conflicts when I want to install some nuget packages. For example, If I install the packages Telerik.UI.for.AspNet.Core 2019.3.917 and Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation 3.0.0 in my project, I've get the error :

Error NU1107 - Version conflict detected for Microsoft.CodeAnalysis.Common.
 
MyProject -> Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation 3.0.0 -> Microsoft.CodeAnalysis.Razor 3.0.0 -> Microsoft.CodeAnalysis.Common (>= 3.3.0)
 
MyProject -> Telerik.UI.for.AspNet.Core 2019.3.917 -> Microsoft.CodeAnalysis 3.0.0 -> Microsoft.CodeAnalysis.CSharp.Workspaces 3.0.0 -> Microsoft.CodeAnalysis.Common (= 3.0.0)
Misho
Telerik team
 answered on 25 Dec 2020
3 answers
645 views

I have a aspnet core grid that currently has the following code set to select the current row:

.Events( events => events.Change("onRowSelect"))

 

The function works fine and is written as:

function onRowSelect(e) {
        var row = this.dataItem(this.select());
       .... do work here
)

 

The users have added a new requirement that the event must be a doubleclick event and I'm not sure how to proceed.  Any help would be appreciated.

Thanks

Plamen
Telerik team
 answered on 25 Dec 2020
1 answer
284 views

I have this form:

<div align="center">
    <div>
        <button type="button" class="searchButton" id="search">Search</button>
    </div>
    <div class="col-md-12 row">
        @(Html.Kendo()
                .Grid<ProjectName.DataModels.Models.Customer>()
                .Name("CustomerGrid")
                .Columns(columns =>
                {
                    columns.Bound(e => e.CustomerId);
                    columns.Bound(e => e.SomeCustomerColumn);
                })
                .Sortable()
                .Pageable()
                .Scrollable()
                .Filterable()
                .ClientDetailTemplateId("OrderDetails")
                .HtmlAttributes(new { style = "height:430px;" })
                .AutoBind(false) // Don't load the data yet because I'll need to supply parameters for the fetch
                .DataSource(dataSource => dataSource
                            .Ajax()
                            .PageSize(20)
                            .Read(read => read.Action("GetCustomersAsync", "Customer"))
                )
                .Events(events => events.DataBound("dataBound"))
        )
 
        <script id="OrderDetails" type="text/kendo-tmpl">
            @(Html.Kendo()
                    .Grid<ProjectName.DataModels.Models.Order>()
                    .Name("OrderDetails_<#= CustomerId #>")
                    .Columns(columns =>
                    {
                        columns.Bound(o => o.ProductName);
                        columns.Bound(o => o.SomeOrderColumn);
                    })
                    .DataSource(dataSource => dataSource
                                .Ajax()
                                .PageSize(10)
                    )
                    .AutoBind(false)
                    .Pageable()
                    .Sortable()
                    .ToClientTemplate()
            )
        </script>
    </div>
</div>
 
<script type="text/javascript">
 
    function dataBound() {
        this.expandRow(this.tbody.find("tr.k-master-row").first());
    }
 
    $("#searchButton").on("click", function () {
        var startDate = $("#startdate").data("kendoDatePicker").value();
        var endDate = $("#enddate").data("kendoDatePicker").value();
 
        // How to load the customerGrid here by sending over the startDate and endDate? They are set from Kendo Date Pickers.
        // How to load the child grid: OrderDetails_123 by using the datasource used by the parent grid?
 
    });
</script>

 

And a method in the 'Customer' controller:

public async Task<ActionResult> GetCustomersAsync([DataSourceRequest] DataSourceRequest request, DateTime start, DateTime end)
{
    var consolidatedData = GetDataForParentAndChildGrid(start, end);
    return Json(new[] { consolidatedData }.ToDataSourceResult(request));
}
private ConsolidatedDataModel GetDataForParentAndChildGrid(DateTime start, DateTime end)
{
    var testData = new List<CustomerData>();
    // Gets required data with those dates filter and does a lot of mathematical calculations on them
    testData.Add(new CustomerData
    {
        CustomerId = "123",
        SomeCustomerColumn = "Blah blah",
        Orders = new List<OrderData>()
        {
            new OrderData{
                OrderId = "123ABC",
                CustomerId = "123",
                SomeOrderColumn = "Blah Blah Blah"
            }
        }
    });
    var consolidatedData = new ConsolidatedDataModel()
    {
        Data = testData
    };
    return consolidatedData;
}

 

After I click the "Search" button (which will take into account the start and end date fields to fetch the data), I'd like to update the 'dataSource' for the parent grid and the child grid. As you can see, the data I need for the parent grid already has data that I need for the child grid so I cannot do a new action call to populate the child grid. How do I accomplish this?

Please help.

Thank You!

 

 

 

 

Nikolay
Telerik team
 answered on 24 Dec 2020
1 answer
314 views
I have an ASP.NET Core (.NET 5) project open in Visual Studio 2019 (16.8.3) but when I try to convert it to a Telerik Project, I receive the following error. What's the best way to solve this?

Failed to execute command.

System.NullReferenceException: Object reference not set to an instance of an object.
   at Telerik.KendoUI.ASP.NET.Core.VSX.Wizards.ConvertWizard.GetPropertyValue(String propertyName)
   at Telerik.VSX.WizardEngine.Controls.WizardControlBase.PopulateCollectedValues(IPropertyDataDictionary gatheredData)
   at Telerik.VSX.WizardFramework.Pages.DynamicPageController.GetData()
   at Telerik.WizardFramework.Wizard.GetCurrentPageData()
   at Telerik.WizardFramework.Wizard.UpdateNavigation()
   at Telerik.WizardFramework.Wizard.EnsureInitialized()
   at Telerik.VSX.WizardEngine.ScenarioManagement.ScenarioDefinitionExecutor.CreateWizard(IWizardContext wizardControlContext, IDispatcher dispatcher, IWizardUI ui)
   at Telerik.VSX.WizardEngine.ScenarioManagement.ScenarioDefinitionExecutor.CollectData(IDispatcher dispatcher)
   at Telerik.VSX.WizardEngine.ScenarioManagement.ScenarioDefinitionExecutor.CollectData()
   at Telerik.VSX.ProjectManagement.StreamlinedProjectConfiguration.LaunchWizard(ProjectConfigurationType options)
   at Telerik.VSX.ProjectManagement.StreamlinedProjectConfiguration.LaunchWizard(ProjectConfigurationType options, PrepareWizardDelegate prepareWizardDelegate, CheckPrerequisitesDelegate checkPrerequisites)
   at Telerik.KendoUI.ASP.NET.Core.VSX.ProjectConfigurators.StreamlinedProjectConfiguration.StartConvertWizard()
   at Telerik.KendoUI.ASP.NET.Core.VSPackage.CommandExecutor.Execute(UInt32 commandId)
   at Telerik.VSX.VSPackage.PackageBase.CommandCallback(Object sender, EventArgs e)
Nikolay Mishev
Telerik team
 answered on 23 Dec 2020
3 answers
365 views
     I can only create 2.0 and 2.1 projects for some reason. I've just downloaded and installed VS 2019 (with ASP.NET Core) and Telerik (using the Progress Control Panel) and it won't let me create a 3.1 project.
Dimitar
Telerik team
 answered on 22 Dec 2020
1 answer
338 views

Hi,

  I am able to bind the form to a view model, but I want to add some extra text or image between fields, is it possible?

 

Thanks,
Wesley

Ivan Danchev
Telerik team
 answered on 21 Dec 2020
1 answer
102 views

On this page:

https://www.telerik.com/aspnet-core-ui/listbox

There is a See Demo button that references this link:

http://demos.telerik.com/kendo-ui/listbox/index

 

This link is incorrect as it brings me to the "Kendo UI for JQuery".  Instead, I expect it to bring me to the aspnet core demos

https://demos.telerik.com/aspnet-core/listbox/templates

 

This is quite confusing.

Eyup
Telerik team
 answered on 21 Dec 2020
2 answers
453 views

Hi

I am having trouble understanding what some of these options do and having trouble to find documentation about it

 

@Html.Kendo().Grid<Model>().Name().Columns().DataSource(source => source.Ajax().PageSize(20).Model(m => model.Id(p =>p.Id)).ServerOperation(false).Read(read => read.Action("","").Data("getId")

 

I don't understand what Model does in Datasource, ServerOperation(false), and .Data("getId").

I also have a endpoint 

public ActionResult GetData([DataSourceRequest] DataSourceRequest, int id){ // some stuff }

 

 

I understand this is hit by the Action Method in read but I don't understand why most of the DataSourceRquest in empty (for instance page size is 0, when I would think it would be 20).

 

 

 

Nikolay
Telerik team
 answered on 21 Dec 2020
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?