Questions tagged [display-templates]

Display template is a html template which can be repeat for each item in its model and it will load in specific section of a view of asp.net web application. A template can have styles/scripts or Razor codes in itself also.

102 questions
6
votes
1 answer

Changing date format in display templates for SharePoint 2013

I have a Content Search Webpart that uses a customized Display Template to display results of recent changed documents. I would like to show the "last modified-date" below the document Title. I can then use #= ctx.CurrentItem.ModifiedOWSDATE =# to…
Terje A T
  • 63
  • 1
  • 1
  • 3
6
votes
1 answer

CSS Display Template Extra Space in Class Name

I am using a Display Template in my C# MVC4 application to structure how I want my custom model to be displayed in a datatable within my view. For the datatable, Im using datatables.net. In the following code I give each the class name…
HendPro12
  • 1,094
  • 3
  • 17
  • 50
5
votes
3 answers

How to exclude a field from @Html.EditForModel() but have it show using Html.DisplayForModel()

I am reading up on ASP.NET MVC and all of it's fun uses and I just found out about DataTemplates. In my hurry to test this thing out, I converted one of my simpler models over to using @Html.DisplayForModel() and @Html.EditForModel() and it worked…
Roland Tepp
  • 8,301
  • 11
  • 55
  • 73
5
votes
3 answers

Customize EditorFor or any XXXXFor

Whenever I use @Html.EditorForModel() following the standard template is displayed in asp.net mvc Default in Asp.net MVC template
4
votes
1 answer

How to make display template in MVC 4 project

Hi i'm building application in MVC and i want to use a display template to display my model in a view. This is my template, but it gives me error when I try to display…
user3062466
4
votes
1 answer

Try to access a property of parent viewmodel in displaytemplate

I'm trying to build an asp.net mvc 4 application that makes use of partial views and display/editortemplates and Kendo ui. I have a viewmodel for a specific page: public class Plant { public Guid PlantId{ get; set; } public string Name {…
3
votes
2 answers

Display template not used for interface

I'm having a problem with display templates and dealing with interfaces and objects which implement the interface. In the example I have many objects, which I want to be rendered in a fixed way, I decided to create an interface and reference this…
Martin
  • 1,355
  • 2
  • 14
  • 21
3
votes
1 answer

ASP.net MVC - specify full path of a Display Template

Is it possible to specify the full path of a Display or Editor template? For example, I have the following model: public class ParentModel { public class ChildModel { get; set; } } I have a ParentController and a ChildController and I would…
Dismissile
  • 32,564
  • 38
  • 174
  • 263
3
votes
1 answer

Can you [Obsolete] a DisplayTemplate in Razor?

I created a display template in Razor specifically for displaying currency, which I now want to remove in my code and replace with a standard text display template that accepts a string format (which I can set to "C"). There are a lot of occurrences…
Adam
  • 619
  • 1
  • 4
  • 19
3
votes
1 answer

Creating an MVC 3 Razor - Display Template Library for sharing across multiple projects/solutions

Is it possible to put Display Templates in a separate VS project that can then be referenced by my web site projects. I like using display templates but I don't like the idea of re-use via copy and paste as this soon becomes a headache.
Rob
  • 10,004
  • 5
  • 61
  • 91
3
votes
1 answer

How to render ModelMetadata object using Html.Displar in Razor-engine in ASP.NET MVC app?

I am trying to utilize the DisplayTemplates feature in razor-engine to automate rendering my display views. I scan my Model to find the correct ModelMetadata for each property that I want to display. But I am not able to render the properties using…
Junior
  • 11,602
  • 27
  • 106
  • 212
3
votes
0 answers

how to bind data from a grid to a textbox in an irpt file

i have the following grid DateCreated |ID | State 18/01/2016 |0005 | N I can get the data in an alert when i double click on the row as following: function getData (){ var gridObjects=GridTableData.getGridObject(); var ID =…
doe
  • 148
  • 4
  • 25
3
votes
0 answers

MVC 4 Custom HTML Helper Vs Custom Display Template

So, I've an obj structure something like below. ComparedObject: public List Objs { get; set; } public string PropName { get; set; } ModelObj: public List CObjs { get; set; } I've a scenario in which I would need to loop…
Praveen
  • 1,449
  • 16
  • 25
3
votes
1 answer

sharepoint 2013 Control Display Template : how to know how many items we'll get

What i Want : I would like a custom menu on my home page. I would like to display 4 images (and links) (coming from a custom link application) in a square. (like at every edge, a couple image/link) Not like a simple list (see this : MyImage1.jpg…
Gaelle
  • 614
  • 1
  • 7
  • 30
3
votes
2 answers

SharePoint Visual Studio deploy does not overwrite display templates on update

I have a VS SharePoint project where I placed some files in, in this case display templates. The elements.xml has ReplaceContent tot TRUE on each FILE entry The "Deployment Conflict Resolution" properties setting is "PROMPT" I see everything gets…
edelwater
  • 2,650
  • 8
  • 39
  • 67