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

Edit Popup Template Name ignored???

16 Answers 1217 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Marcel
Top achievements
Rank 1
Marcel asked on 05 May 2017, 03:18 PM

This worked in .NET 4. not so in Core. Is there an alternative to custom popup templates ???

.ToolBar(toolBar => {toolBar.Create();})
.Editable(e => { e.Mode(GridEditMode.PopUp); e.TemplateName("MaterialEdit");})
.Navigatable()

16 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 10 May 2017, 10:43 AM
Hello Marcel,

Before we can proceed with your technical questions, I will need more information about your current UI for ASP.NET MVC Core subscription. I have therefore involved a product specialist, who will be following up with you shortly to help answer any licensing questions you might have.

If your company has already purchased a license from another account, please contact the license holder and provide them with this link so they can add you as a licensed developer. If you need to purchase or renew your subscription, have a look at the most frequently asked questions here or post your questions here. Additionally, you can reach out to our product specialists on telerik-sales@progress.com. They will gladly assist you with finding both the answers to your questions and a subscription that best fits your needs.

Once your account is associated with an active subscription, you can post your questions in a new support ticket or repost them here and we will reply within the guaranteed 24 response time. On top of that, you will have access to the latest features and fixes within our products and you will have the ability to affect their roadmaps.

If you choose not to continue with a paid subscription, we will immensely appreciate your feedback on the reasoning behind your decision. This information would help us determine the show-stoppers that developers like you face and better address these in the future.

Regards,
Stefan
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data (charts) and form elements.
0
Stefan
Telerik team
answered on 11 May 2017, 01:14 PM
Hello Marcel,

Also, I can suggest checking if using the following syntax will work:

.Editable(ed => ed.Mode(GridEditMode.PopUp).TemplateName("MeterialEdit"))

If this still does not work, please provide us with a runnable example reproducing the issue and I will gladly assist.

Regards,
Stefan
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data (charts) and form elements.
0
Hannes
Top achievements
Rank 1
answered on 16 Oct 2017, 07:29 AM

I have the same issue. I opened a support ticket with a runnable example attached.

Still posting here in the forum. Maybe someone else has already found a solution for this or knows what I am doing wrong.

If a staff member reads this, feel free to close my ticket and reply here (so that other benefit from the knowledge too).

Regards,

Hannes

 

 

 

0
Stefan
Telerik team
answered on 19 Oct 2017, 05:40 AM
Hello, Hannes,

I noticed that my colleague has already provided an answer to the question.

The main point is that the editor templates have to be placed inside the following folder:

"Views/Shared/EditorTemplates"

I noticed that there are additional questions. Once the ticket is fully resolved, we can add the additional beneficial information in this thread as well.


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.
0
CLOCA
Top achievements
Rank 1
answered on 19 Oct 2018, 09:04 PM
Is there any way to handle an invalid template name? 

I'm trying to prevent the popup window from using the default edit template if the grid has been given an editor template name that does not exist in the EditorsTemplate directory. 
0
Viktor Tachev
Telerik team
answered on 24 Oct 2018, 11:48 AM
Hello Cloca,

By default when popup edit mode is enabled for the Grid the editor will be created using EditorForModel. If you would like to have a custom popup editor for the Grid I would suggest using an approach similar to the one illustrated in the example below:



Regards,
Viktor Tachev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
CLOCA
Top achievements
Rank 1
answered on 24 Oct 2018, 01:17 PM
Hello Viktor, 
Thank you for getting back to me.  I am already using a custom popup editor for my grids and they are working perfectly! 

My issue is occurs when I provide my grids with an invalid EditorTemplate name, say "Person2" instead of "Person" looking at your example. 
What I am trying to do in the situation above is to display an error message.  However instead what happens is a default form appears with all of my models fields.  Is there a way to solve this problem? 



I've also attached an image to help explain.  I would normally like to display FeeCalculatorCategoryTemplate, but if the template name changes to a template name that is not found I would like to display ErrorMessageEditTemplate instead. 



0
Viktor Tachev
Telerik team
answered on 29 Oct 2018, 09:02 AM
Hello Cloca,


The templates that are used are handled by the framework. When a template name is set the framework will look for a partial view with that name in the EditorTemplates folder. If such file is not found .NET will fallback and use the default editors.


Regards,
Viktor Tachev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
CLOCA
Top achievements
Rank 1
answered on 29 Oct 2018, 07:42 PM
Ok, thank you for getting back to me!
0
Christian Sandöy
Top achievements
Rank 2
answered on 31 Oct 2018, 12:16 PM

I cant get the popup template to work in asp.net core 2.2 with tag helper 

it shows the template name in popup in sted of the  template

 the template is in Views/Shared/EditorTemplates

0
Viktor Tachev
Telerik team
answered on 01 Nov 2018, 12:32 PM
Hello Christian,

The template used in the TagHelper should be specified in a script tag.

<editable mode="popup" template-id="editTemplate" />


<script type="text/x-kendo-template" id="editTemplate">
    custom popup template
</script>


Check out the article below that describes how such a template can be created. The article is about the Kendo Grid for jQuery, however, the approach for creating a custom popup editor will be the same with the TagHelper.


Regards,
Viktor Tachev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Christian Sandöy
Top achievements
Rank 2
answered on 01 Nov 2018, 12:36 PM
Where is the link?
0
Viktor Tachev
Telerik team
answered on 01 Nov 2018, 01:09 PM
Hello,

Here is the link I was referring to. Sorry for missing it.



 
Regards,
Viktor Tachev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Stefano
Top achievements
Rank 1
answered on 13 Jan 2019, 09:04 AM

Hi, i've setted the full path to my template view and it's work.

TemplateName("~/Areas/(FunctionalArea)/Views/Shared/EditorTemplate/(templatename).cshtml")

Stefano

0
Chris
Top achievements
Rank 1
Veteran
Iron
Iron
answered on 12 Nov 2019, 02:40 AM

HI

I got the abnormal situation about .NET Core Grid popup edit with Editor Templates : 

First, the custom editor (EditorTemplates/.cshtml) was found
(Start debugging could enter breakpoint of the view).

But the View's this.Model* property is always null.

*View's this.Model property will be a empty instance of the model in ASP.NET MVC.

View

@(Html.Kendo().Grid<TViewModel1>()
      .Name("...")
      ...
     .Editable(editable =>
     {
       editable.Mode(GridEditMode.PopUp);
       editable.TemplateName("Editor1");
       editable.Window(window => window.Title("...").Width(700));
     })
     ...

Editor Templates/Editor.cshtml

@(Html.Kendo().TextBoxFor(model => model.ProductID))  <--- Model is null, page rendering terminated


Why the Telerik UI for ASP.NET Core xx 2019 Example have no such example ??

Is there have the official example about Grid Popup Editing with the custom Editor Templates of .NET Core 2.2 or more.

*Visual Studio 2019 Enterprise 16.2.
*Telerik UI for ASP.NET Core R2 2019.
*.NET Core 2.2.

Best regards

Chris

 

 

0
Viktor Tachev
Telerik team
answered on 14 Nov 2019, 02:04 PM

Hello Chris,

 

We have an example showing how a custom popup editor can be used in the UI for ASP.NET Core Grid widget. It can be downloaded from our GitHub repository by following the link below.

https://github.com/telerik/ui-for-aspnet-core-examples/tree/master/grid/grid-custom-popup-editor/WebApplication1

 

Give it a try and let me know how it works for you.

 

Regards,
Viktor Tachev
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Sujitha
Top achievements
Rank 1
commented on 10 Sep 2023, 03:10 PM

Can you please repost the  link . I have a similar situation.
Viktor Tachev
Telerik team
commented on 13 Sep 2023, 10:32 AM

We have restructured the repository and the examples are added in a common project. You can see the View for the Custom Popup editor example below:

https://github.com/telerik/ui-for-aspnet-core-examples/blob/master/Telerik.Examples.Mvc/Telerik.Examples.Mvc/Views/Grid/CustomPopUpEditor.cshtml

 

In addition, below you can find instructions on how to download and run the examples project locally.

https://github.com/telerik/ui-for-aspnet-core-examples/tree/master/Telerik.Examples.Mvc

 

Tags
Grid
Asked by
Marcel
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Hannes
Top achievements
Rank 1
CLOCA
Top achievements
Rank 1
Viktor Tachev
Telerik team
Christian Sandöy
Top achievements
Rank 2
Stefano
Top achievements
Rank 1
Chris
Top achievements
Rank 1
Veteran
Iron
Iron
Share this question
or