Telerik Forums
UI for ASP.NET MVC Forum
1 answer
6 views
Hi Team,

I am using kendo date picker for in custom editor template for a kendo grid for pop up editing which is bind to datetime field of the model, now while displaying the value in the kendo date picker in custom editor template the value is displayed according to the user/client machine time zone which is changing the date value when the user is in some other time zone other than EST as application server is in EST , how to resolve the display issue in the kendo date picker for??
I am using the below code in custom editor template.
Please guide how to resolve this?


<div class="editor-field">
        @(Html.Kendo().DatePickeFor(m=>m.EndDate)
            .Format("MM/dd/yyyy")
            .Value(Model.EndDate)
           )
        @Html.ValidationMessageFor(m => m.EndDate)
</div>
Mihaela
Telerik team
 answered on 15 Sep 2025
1 answer
22 views

Hello there,
i have a project with MVC Asp.Net, Kendo v. "2024.4.1112.462" and would like to
- load data into grid, the data is returned by MVC Controller
- the spinner with the "loading data in progress" should never appear
- so the user can "play" on the grid header filters while loading data is ongoing 
- when the user clicks on "apply" on grid header filter, the previous request must be canceled to run the new request with latest filters applied, in this way the c#  CancellationToken is Canceled on server side.

Can you tell me how to "cancel" the actual http request from the kendo grid (client) and execute the new one, as described in the last point?

thanks in advance

Anton Mironov
Telerik team
 answered on 30 Jul 2025
0 answers
25 views

Good morning,
i am using MVC.ASP net in my project and i'm trying to send the DataSourceRequest to a service , via rabbitmq.

the message should contains all the request filters set in the ui in order to create an excel report. i have tried to use the System.Text.Json serialization but it's not working properly. it serializes only the first level props.
i have found a ".ToJson" extension  but it's returning a Dictionary<string, object>, not usefule here.

can you suggest how to serialize the DataSourceRequest in Json format? with all nested and recursive properties?

the filters can be about dates, strings, combobox, and so on

thanks in advance

1 answer
27 views
good morning,
i am facing a strange behavour with the datetime filter in grid.
when i set a date on the second filter about the "Is before" and none in the "Is after on", launch the grid data and re-open the date filter, values are inverted, see attachments "before" and "after".
can you tell me how to block the filter positions? "is after on" set always as first and "Is before" alwasy set as second.

thanks in advance
Mihaela
Telerik team
 answered on 16 Jul 2025
10 answers
2.1K+ views

Hi Guys

This stupid little issue is taking up way way too much time for me to resolve..

I am setting a timepicker as follows:

  <td class="tg-7uzy">

                @Code
                    With Html.Kendo().TimePicker()
                        .Name("1Open")
                        .Events(Function(events) events.Change("settime"))
                        .Value(New TimeSpan(0, Model.Hours(1).open, 0))
                        .Min(New TimeSpan(0, 0, 0))
                        .Max(New TimeSpan(0, 0, 0))
                        .Render()
                    End With
                End Code
            </td>

The result is as per the attached screen shot.

It 'looks like' the values are set right as the timepickers have the correct times , but when you drop down, it always starts at midnight and the current time is not highlighted.  I assume the timepicker needs the value to be set with AM or PM .. but that can't be done from a TimeSpan or a datetime.. the am pm always has dots ( a.m.  , p.m.)

 

If tried adding .Format("HH:mm:tt") and  .ParseFormats(New String() {"HH:mm:tt"}) etc, but I just can't get it to work. ( I've tried allot more formats than just these, I've tried "HH:mm tt" ,"HH:mm t.t." ( cause it's the dots around the am pm which seems to be whats stopping.))

Feeling a bit stupid having to ask this as it seems to be a straightforward thing.

I'm sure I will have a Face palm moment when shown the error in my ways.. but I've got to the point of not caring! :)

Cheers

Rob

 

Lorenzo
Top achievements
Rank 1
Iron
 answered on 30 Jun 2025
1 answer
68 views

Hi,

I have a Kendo Grid and its first column is a Datetime and Its a Kendo DatePicker.

When the user click on Add new record button then the 1st cell which is a date picker should be auto focus.

Note: When the user click on Add new record button then we are sorting the grid in ascending order so that the new row should appear on the top, which is working fine but the 1st cell of the newly created row a Kendo Date picker in not in focus.

 

But when the user click on the first cell of the newly created row, then it opens the datepicker to allow user to select a date.

 

My requirement is when i am clicking the Add new record button then 
1. It should sort in ascending order (Which is working now)

2. The 1st cell of the Kendo Datepicker should auto focus like the above screenshot.


 
abdul
Top achievements
Rank 2
Iron
Iron
 updated question on 09 Jun 2025
1 answer
129 views

I am using a Kendo.Filter object like the following to filter results in a Kendo Grid:

@(Html.Kendo().Filter<CustomPersonClass>() .Name("personFilter") .DataSource("peopleDS") .ApplyButton(false) .Fields(f => {

f.Add(p => p.LastName).Label("Last Name");
         f.Add(p => p.FirstName).Label("First Name");
         f.Add(p => p.MiddleName).Label("Middle Name");

f.Add(p => p.StartDate).Label("Start Date").Operators(o => o.Date(d => d.Eq("Is equal to").Gte("Greater than equal").Lte("Less than equal"))); }) )

 I have helper code to handle the toolbar in my Kendo Grid like the following, :

@helper ToolbarTemplate()
{
    <button class="k-button k-button-solid k-button-solid-base" id="applyFilter"><span class="k-icon k-i-filter"></span>Apply Filter</button>
    <button class="k-button k-button-solid k-button-solid-base" id="clearFilter">Reset</button>
    <button class="k-button k-grid-excel k-button-solid k-button-solid-base"><span class="k-icon k-i-excel"></span>Export to Excel</button>
}

I also have some JavaScript in a function to apply the filter when the Apply Filter button is clicked, as seen here:

$("#applyFilter").click(function (e) {
    //e.preventDefault();
    var myFilter = $("#personFilter").getKendoFilter();
    localStorage["kendo-person-filter-options"] = kendo.stringify(myFilter.getOptions().expression);
    myFilter.applyFilter();
});

 

The problem I am having is if I enter an invalid Leap Year date (e.g. 2/29/2003, since 2023 didn't have a February 29th), I get no data back; however, if I enter a valid Leap Year (e.g. 2/29/2004), my Kendo Grid will show data.  Is there a way to validate the date that is being entered manually into a DatePicker field used for filtering?  That is, if I use the DatePicker, it will not show me 2/29/2003 as an option, but if I type in 2/29/2003 and click Apply Filter, it doesn't throw any kind of error about 2/29/2003 being invalid.

Andy
Top achievements
Rank 1
Iron
 answered on 08 Jan 2025
1 answer
141 views

I have a datepicker in a view 

@(Html.DatePickerFor(model => model.EventDate)
     .Format("{0:dd/MM/yy}")
)

I need to retrieve the date from the datepicker to use as the minimum value for a datetimepicker in a list view. 


		shiftStart.kendoDateTimePicker({
			timeFormat: "HH:mm",
			format: "dd/MM/yyyy HH:mm",
			// min: new Date(vYear, vMonth - 1, vDay, vHour, vMinute),
			interval: { minutes: 15 }
		});

How do I get that value?

Ivan Danchev
Telerik team
 answered on 03 Oct 2024
1 answer
119 views

We want to use the DatePicker like this:

<div class="row">
    <div class="col">
        <div class="form-group">
            @Html.LabelFor(model => model.TESTDATUM, htmlAttributes: new { @class = "control-label" })
            <div>
                @Html.Kendo().DatePickerFor(model => model.TESTDATUM)
                @Html.ValidationMessageFor(model => model.TESTDATUM, "", new { @class = "text-danger" })
            </div>
        </div>
    </div>
</div>

But this renders the control like this:

We're currently using the following workaround to trim the overlapping part, which feels kind of 'hacky':


<div style="width: 17.5em">
    @Html.Kendo().DatePickerFor(model => model.TESTDATUM)
</div>
Is there a better/cleaner way to have the control to render correctly (with Bootstrap)?
Aleksandar
Telerik team
 answered on 16 Sep 2024
1 answer
97 views

A bug has been introduced recently where the calendar icon for DatePicker does not display

I can duplicate this bug using your REPL

https://demos.telerik.com/aspnet-core/datepicker

From here I add after line 9

.HtmlAttributes(new { @style = "width: 150px;"})

As you can see this results in no calendar to pick the date

If you make it even wider some of the icon becomes visible

.HtmlAttributes(new { @style = "width: 200px;"})

And at 250 it is fully visible

.HtmlAttributes(new { @style = "width: 250px;"})

We do this across our app using an extension method and it was previously working.

        public static DatePickerBuilder Width(this DatePickerBuilder builder, int width)
        {
            builder.ToComponent().HtmlAttributes.Merge("style", "width:" + width.ToString() + "px");
            return builder;
        }
Ivan Danchev
Telerik team
 answered on 02 Aug 2024
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?