Telerik Forums
UI for ASP.NET Core Forum
3 answers
214 views

Hi, I'm currently trying to filter a grid using an external component like the dropdown menu. I've used the instructions found in this form thread.

How would I pass the name of the drop down menu as well as the id or text data associated with the selection.

For example here is my current code:

Javascript

<script>
    var menuName
    var menuItem
    function additionalData(e) {
        return {
            item: menuName + " " + menuItem
        }
    }
    function onChange(e) {

         //What would I put here to get the name or id of the dropdown? id, name, &ct.toString() do not work

        menuName = this.name() 
        menuItem = this.text()
        var grid = $("#analogGrid").data("kendoGrid")
        grid.dataSource.read()
    }
</script>

 

Grid HTMLHelper

//...
.Read(read => read.Action("Analogs_ReadAsync", "Analogs").Data("additionalData"))
//...

 

Controller Action

public async Task<JsonResult> Analogs_ReadAsync([DataSourceRequest]DataSourceRequest request, string item) {...}

 

Catherine
Top achievements
Rank 1
 answered on 29 Jun 2018
1 answer
280 views

I have the following code:

.Columns(columns => {
    columns.Bound(c => c.CreatedDateTime).Width(180).Format("{0: dd MMM yyyy HH.mm}").Title("Date");
    columns.Bound(c => c.Action.ActionDateTime).Format("{0: dd MMM yyyy HH.mm}").Width(280).Title("Action Date");
})

 

Both columns show the date and the JSON seems to have both dates correctly passed through.

However the 1st one displays the date correctly and the second one does not.

1st DateTime: 01 May 2018 08.45

2nd DateTime: 2018-06-01T13:01:05

 

Further details:

The data is obtained from two joined tables using EF Core.

I had to add the Json option Referenceloophandling.ignore to get the data to pass through, though I doubt this has anything to do with the problem as the Telerik Grid obviously has the correct data.

 

Can someone please help me format this date correctly.

 

Thanks,

Ricky

Konstantin Dikov
Telerik team
 answered on 29 Jun 2018
1 answer
548 views

I am trying to use unobtrusive validation for an ajax form inside a window.  However if the window is opened multiple times then closed the validation fires multiple times.   If I move the script to the main page then the validation does not fire at all.

Where should I place the validation script and how do I get it to fire only once?

 

@model MyProject.Models.Input
 
@{
    Layout = null;
}
 
 
<script src="~/lib/jquery-validation/dist/jquery.validate.js"></script>
<script src="~/lib/jquery-validation-unobtrusive/dist/jquery.validate.unobtrusive.js"></script>
<script src="~/lib/jquery.unobtrusive-ajax/dist/jquery.unobtrusive-ajax.js"></script>
@*<form asp-controller="Home" asp-action="Edit"
    data-ajax-begin="onBegin" data-ajax-complete="onComplete"
    data-ajax-failure="onFailed" data-ajax-success="onSuccess"
    data-ajax="true" data-ajax-method="POST">*@
 
<form asp-controller="Input" asp-action="Edit"
      data-ajax-complete="onComplete"
      data-ajax-failure="onFailed" data-ajax-success="onSuccess"
      data-ajax="true" data-ajax-method="POST">
 
    <input type="hidden" asp-for="InputID" />
    <input type="hidden" asp-for="TemplateID" />
    <label asp-for="Input" class=""></label>
    <input asp-for="Input" autocomplete="off" class="k-textbox" />
    <br />
    <label asp-for="Description" class=""></label>
    <input asp-for="Description" autocomplete="off" data-val="true" class="k-textbox" />
    <span asp-validation-for="Description" class="text-danger"></span>
    <br />
    <label asp-for="DisplayOrder" class=""></label>
    <kendo-numerictextbox for="DisplayOrder" format="0" />
    <br />
    <label asp-for="Format" class=""></label>
    <input asp-for="Format" autocomplete="off" class="k-textbox" />
    <br />
 
    <input type="submit" value="Save" class="btn btn-primary" />
 
</form>
Bozhidar
Telerik team
 answered on 28 Jun 2018
2 answers
3.1K+ views

Hello,

we implemented an onBeforeEdit listener for our popup-editing-grid as follow:

this.beforeEditHandler = function (e) {
        var isDirty = dataSourceIsDirty();
        if (isDirty) {

            ...
            e.preventDefault();
        }
    }

When dirty grid-items exist, the edit-popup should not appear. This works fine when trying to edit a row, the popup is not being shown. However, when we try to create a new dataItem, the popup does not appear also, but a new empty row is being added to the grid (see attachment).

 

Any idea of how to prevent the grid to insert an empty row?

 

Thanks.

Dima
Top achievements
Rank 1
 answered on 27 Jun 2018
4 answers
535 views

I have a small list of items that i need to present on a form. The user can select multiple items with the help of checkboxes. And after the user is done he needs to save the form.

I have seen a similar example on telerik products but for ajax

https://demos.telerik.com/aspnet-ajax/listbox/examples/functionality/checkboxes/defaultcs.aspx

Is there a way to implement the same functionality in Asp.Net Core?

Dan
Top achievements
Rank 1
Iron
Iron
Veteran
 answered on 26 Jun 2018
2 answers
935 views

I'm porting an MVC application that uses Kendo UI to .NET Core.  The existing application has considerable styling created by another team and the ported application needs to look like the old one.  The new application is not picking up the old styles (I've double checked the css files and I'm sure they're all in the right location).  When I look at the source on the old code, I see:

<div class="k-widget k-grid" id="grid">

Wrapping the kendoGrid object.  When I look at the source for the new code, I see:

<div id="grid" name="grid">

Around the grid.  Is there a difference between the MVC and .NET Core products in the way the default styles are specified?  Is there a way to explicitly state what styles are used?  Any idea what I might be missing between the old and new versions? 

Viktor Tachev
Telerik team
 answered on 26 Jun 2018
1 answer
1.1K+ views

I'm porting an MVC application that uses Kendo UI to .NET Core.  The existing application has considerable styling created by another team and the ported application needs to look like the old one.  The new application is not picking up the old styles (I've double checked the css files and I'm sure they're all in the right location).  My source looks like this:

    <div class="col-md-10">
            @(Html.Kendo().Grid<FundViewModel>()
                                    .Name("grid")

                                        ....

When I look at the HTML source on the old code, I see:

<div class="k-widget k-grid" id="grid">

Wrapping the kendoGrid object.  When I look at the HTML source for the new code, I see:

<div id="grid" name="grid">

Around the grid.  Is there a difference between the MVC and .NET Core products in the way the default styles are specified?  Is there any reference reading material that talks about styling in the .NET Core product?  Is there a way to explicitly state what styles are used?

Dimitar
Telerik team
 answered on 26 Jun 2018
1 answer
267 views

Hi,

I have to create a room reservation calendar,

I see this sample https://demos.telerik.com/aspnet-core/scheduler/timeline and have some questions :

1) Is it possible set ".Resources(resource => ..." server side ?

2) I need only MONTH view, so is possible don't have the HOURS row ?

3) When I drag an item from cell to enother or resize an item,  is there a validation system ? (if can't be done, the operation must be canceled)

4) Scheduler can be exported (pdf/excel) like grid ?

 

Thank you

Ianko
Telerik team
 answered on 25 Jun 2018
5 answers
2.0K+ views

Is there a way to replace the text in the grouping header? For example, instead of showing daypart: 20180615AM after grouping by the daypart column I want to display Fri June 15 AM.

 

Tom
Top achievements
Rank 1
 answered on 22 Jun 2018
3 answers
129 views

Hi Team;

I have installed Kendo UI fpr ASP Core into my project. Is there anyway that I can change theme "Visually" like a drop down list of themes Kendo UI offers that would automatically changes inside _Layout or anywhere else related?
Or at least a doc guideline of exact changes to be made manually to ensure we can change to the list of Default themes or Bootstrap themes based on the attached pic?

Thanks

..Ben


Veselin Tsvetanov
Telerik team
 answered on 22 Jun 2018
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?