This is a migrated thread and some comments may be shown as answers.

Popup Grid Edit Mode with timepicker

2 Answers 292 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Evan
Top achievements
Rank 1
Evan asked on 19 Apr 2018, 07:43 PM

I'm trying to use GridEditMode.PopUp to enter times.  I currently get the full date in a text box (see pic)

I originally used InLineEditing and was able to use the following:

columns.Bound(c => c.Arrival).Format("{0: HH:mm}").EditorTemplateName("TimeEdit");

 

This however does not work for PopUp editing.  I found out that in order to make the "Name" column not editable in PopUp editing I had to create the following function in the view:

 

    function EditGrid(e) {
        if (!e.model.isNew()) {
            $('#Name').attr('readonly', 'readonly');
        }
    }

 

I am guessing in this function is where I may be able to set the Arrive box to a time picker, but I can't find anything to work. 

2 Answers, 1 is accepted

Sort by
0
Evan
Top achievements
Rank 1
answered on 20 Apr 2018, 01:50 PM

The EditorTemplateName("TimeEdit") is a shared editorTemplate as follows:

 

<div class="input-group bootstrap-timepicker">
    <label class="delay-label"></label>
    @Html.Kendo().TimePickerFor(m => m).Interval(1)
    
</div>

0
Stefan
Telerik team
answered on 23 Apr 2018, 06:29 AM
Hello, Evan,

Thank you for the details.

I can assume that the issue occurs due to the reason how the editor templates are handled in Popup Edit mode.

Please check the following post and StackOverflow describing how custom editors can be placed in Popup Edit mode:

https://stackoverflow.com/questions/17677837/kendoui-mvc-editortemplatename-do-not-work-in-popup-edit-mode

The other option will be to use completely custom Popup editor template:

https://www.telerik.com/forums/popup-edit-template

https://docs.telerik.com/aspnet-mvc/helpers/grid/how-to/editing/custom-popup-editor

I hope this is helpful.

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Evan
Top achievements
Rank 1
Answers by
Evan
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or