Telerik Forums
UI for ASP.NET Core Forum
1 answer
93 views

I am trying to create a grid with 4 columns: Field, Operator, Value and a Delete button

The Field column is selectable from a drop down when editing and this I have done using a Action call.

The second column, Operator has a fixed set of operators like '>', '<', '>='. I was hoping to create this list right inside this grid definition. So I chose the overload: columns.ForeignKey(memberName, SelectList) and I have created a SelectList in the second argument. But it does not work and the Operator column is not showing a drop down:

@(
Html.Kendo().Grid<formFilter>()
	.Name("gridFilter")
	.ToolBar(toolbar =>
	{
		toolbar.Create().Text("Add");
		toolbar.Save().Text("Save").CancelText("Cancel");
	})
	.Editable(editable => editable.Mode(GridEditMode.InCell))
	.Columns(columns =>
	{
	columns.ForeignKey(c => c.filterName, ds => ds.Read(r => r.Action("fieldNames", "View1", new { className = "View1" })), "filterName", "filterName").Title("Field").Width(200);
	columns.ForeignKey(c => c.filterEval, new SelectList(
		new List<SelectListItem>
			{
				new SelectListItem { Text = ">", Value = ">"},
				new SelectListItem { Text = "<", Value = "<"},
				new SelectListItem { Text = ">=", Value = ">="},
			}, "Value", "Text"))
		.Title("Operator").Width(200);
	columns.Bound(c => c.filterValue).Title("Value");
	columns.Command(c => c.Destroy()).Width(50);
	})
	.Pageable(pageable => pageable
	.Refresh(true)
	.PageSizes(true))
	.DataSource(dataSource => dataSource
		.Ajax()
		.PageSize(5)
		.Batch(true)
		.ServerOperation(false)
		.Events(events => events.Error("ErrorHandlerForFilterTable"))
		.Model(model =>
		{
			model.Id(p => new { p.filterId });
		})
		.Create("createFilter", "View1")
		.Read(read => read.Action("getFiltersTable", "View1", new { url = @Context.Request.Path }))                                                                                
		.Update("updateFilter", "View1")
		.Destroy(del => del.Action("deleteFilter", "View1"))                                        
	)
)

Alexander
Telerik team
 answered on 30 Apr 2024
1 answer
103 views

Hello,

It is not clear from your documentation whether you are still relying on jszip.js for Excel exports.  We have found that this library has critical security vulnerabilities that have not been addressed by the FOSS developer who created it.

Please advise as to what you recommend.

 

Thanks.

Mihaela
Telerik team
 answered on 29 Apr 2024
1 answer
77 views

Hi,

I have a requirement where backend will send a dataset with multiple datatables as model to UI and I need to display grids for each table of dataset. I am not able to find any solution to use server binding with the datable to the grid.

Any help/suggestions would be appreciated..

Alexander
Telerik team
 answered on 29 Apr 2024
1 answer
65 views
I am using Kendo Multiselect with asp.net core where we have checkboxes . We allow the checkboxes to be multi-selected and unselected by clicking anywhere on label or checkbox. The issue is when a checkbox is selected, I want the focus to stay on the currently checked checkbox wrapped up in a <div> tag, but it's going to the last checked checkbox in the list.
Alexander
Telerik team
 answered on 29 Apr 2024
1 answer
133 views

Just as the title states I'd like to add a tooltip or even title to the options in the listbox. So that when a uses hovers the option the tip appears. The first Listbox binding is done on a SelectListItem List.

 


                @(Html.Kendo().ListBox()
                .Name("lbOptions")
                .ConnectWith("lbSelectedOptions")
                .Selectable(ListBoxSelectable.Multiple)
                .Toolbar(toolbar =>
                {
                    toolbar.Position(Kendo.Mvc.UI.Fluent.ListBoxToolbarPosition.Right);
                    toolbar.Tools(tools => tools
                        .TransferTo()
                        .TransferFrom()
                        .TransferAllTo()
                        .TransferAllFrom()
                    );
                })
                .BindTo(ViewBag.Lists)
            )<!--End of lbProjects listbox-->
                @(Html.Kendo().ListBox()
                .Name("lbSelectedOptions")
                .BindTo(new List<SelectListItem>())
                .ConnectWith("lbOptions")
                .Selectable(ListBoxSelectable.Multiple)
            )<!--End of lbSelectedProjects listbox-->

Anton Mironov
Telerik team
 answered on 26 Apr 2024
1 answer
101 views
I'm using the editor to create a letter as shown in the immutable items example on the demonstration page.  I want to be able to a footer and was wondering if someone could help me.
Anton Mironov
Telerik team
 answered on 26 Apr 2024
1 answer
65 views

I have followed the sample in the demo on how to implement the timeline component.
I am getting the following error: Uncaught TypeError: Cannot read properties of undefined (reading 'left')

    at x (kendo.all.js:321370:19)
    at init._initHorizontal (kendo.all.js:321370:19)
    at init.refresh (kendo.all.js:321370:19)
    at init.trigger (kendo.all.js:321370:19)
    at init._process (kendo.all.js:321370:19)
    at init.success (kendo.all.js:321370:19)
    at success (kendo.all.js:321370:19)
    at n.success (kendo.all.js:321370:19)
    at i (jquery.min.js:2:27466)
    at Object.fireWith [as resolveWith] (jquery.min.js:2:28230)

How can I resolve this ? 
Here is the control in the cshtml page

<div>
    @(Html.Kendo().Timeline<RequisitionModel>()
        .Name("reqTimeline")
        .DataDateField("EventDate")
        .DataDescriptionField("Description")
        .DataSubtitleField("Subtitle")
        .DataTitleField("Title").CollapsibleEvents()
        .Orientation(TimelineOrientation.Horizontal)
        .DataImagesAltField("AltField")
        .DataImagesField("Images")
        .DataActionsField("Actions")
        .DataSource(dt => dt.Read("GetRequisitionEvents", "Recruiting"))
        )
</div>

Lance | Senior Manager Technical Support
Telerik team
 answered on 25 Apr 2024
1 answer
73 views
My grid is configured for InCell editing and AutoSync. After I upgraded to the latest version of Telerik UI for ASP.NET Core, the add button no longer works. It appears to try to add the empty row, but cannot. No error is thrown. Is this a bug or a new 'feature?'
Eyup
Telerik team
 answered on 23 Apr 2024
1 answer
113 views

Hello,

I want to show, group and filter the Id field on one of the grid columns by connecting it to the Enum side.

I used ForeignKey column but it doesn't show the data.

The request is being sent. data is returning. But it doesn't show.

Important Note: I don't use inline editing on the grid. It'll only show.

What's wrong?

Result SET
{
    "Data": [
        {
            "LogoUrl": "",
            "ParentCompany": null,
            "ParentCompanyId": 0,
            "CompanyType": 10,
            "CompanyTypeId": 10,
            "Title": "POL & PAK LTD",
            "Code": "12688900",
            "PostCode": "ST1 4NP",
            "Address": "10 Harcourt Street, Stoke-On-Trent, England, ST1 4NP",
            "ShortNotes": "12688900 - Incorporated on 22 June 2020",
            "VatNumber": null,
            "ExemptVat": false,
            "EoriNumber": null,
            "RegisterNumber": "12688900",
            "CreditLimit": 0.00000,
            "DiscountRate": 0.00000,
            "CreditTerm": null,
            "CreditTermId": 0,
            "Longitude": null,
            "Latitude": null,
            "Status": "Active",
            "StatusId": 10,
            "Id": 1
        }
    ],
    "Total": 1,
    "AggregateResults": null,
    "Errors": null
}

Column
 columns.ForeignKey(p => p.CreditTermId, ds => ds.Read(r => r.Action("GetCreditTerms", "ErpCommon")), "CreditTermId", "CreditTermName").Title("CreditTerm"); 

Endpoint
 public async Task<IActionResult> GetCreditTermsAsync()
 {
     var model = new List<ErpCreditTermViewModel>();

     var availibleCreditTerms = await _erpCreditTermService.GetCreditTermsAsync();
     foreach (var creditTerm in availibleCreditTerms)
     {
         var erpCreditTermViewModel = await _erpCreditTermModelFactory.PrepareCreditTermViewModelAsync(creditTerm);
         model.Add(erpCreditTermViewModel);
     }

     return Json(model);
 }

Alexander
Telerik team
 answered on 18 Apr 2024
0 answers
120 views

I have an AutoComplete control calling my Controller that has the [Authorize] attribute applied to it. When the session expires the control lets you still type in it and tries to call the controller. Nothing happens on the page to show an issue, but in the browser development tools console, there is a jQuery error reporting a 404 error.

The big question is why is it not either getting a 401 error code or following the redirect it is getting to go to the login page? If it was reporting the correct error code than at least I could capture it and redirect it myself or deal with it as I need to.

 

Walter
Top achievements
Rank 2
Iron
 asked on 11 Apr 2024
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?