score:2
Accepted answer
Instead of:
<%=Html.DisplayFor(x => x.MatrixColumns[matrixColumnView.Key].DataTypeName, (string)matrixColumnView.Value.DataTypeName) %>
Just try:
<%=Html.DisplayFor(x => x.MatrixColumns[matrixColumnView.Key].DataTypeName) %>
By passing in (string)matrixColumnView.Value.DataTypeName
- which (presumably) evaluates to "Boolean" - as the second argument, you are telling MVC to look for a display template called "Boolean." Obviously, the template it finds can't display String values. Usually, you're better off letting the framework decide which display template to use.
There's a useful article here that talks about how MVC resolves display/editor templates:
http://bradwilson.typepad.com/blog/2009/10/aspnet-mvc-2-templates-part-3-default-templates.html
Source: stackoverflow.com
Related Articles
- Issue with the string value "Boolean" using HtmlHelper DisplayFor
- Can't add a new record with an integer value into database by using linq from code C#
- Using LINQ to populate a string with a single column value
- How do i obtain foreign table field using string value for fieldname with reflection and entity framework
- Storing result of linq in keyvaluepair with key and value after spliting the String using comma seperator
- C# - code to order by a property using the property name as a string
- How to find item with max value using linq?
- How to get distinct with highest value using Linq
- Using LINQ, how do I find an object with a given property value from a List?
- Using LINQ's Zip with a closure that doesn't return a value
- Check if a String value contains any number by using Lambda Expression
- How to find key value pair in a dictionary with values > 0 with key matching a certain string pattern?
- Select all rows with distinct column value using LINQ
- DataTable: Get Max Value Using LINQ With Criteria Field (GroupBy)
- How to split a string two times with different separators using LINQ?
- Trim String value with particular pattern in C#.NET
- Intersect two lists and return the similarity with the preserved order of the original first string value
- Split string and set default value if separator not found WITH LINQ
- The given value of type String from the data source cannot be converted to type int of the specified target column
- How to read a string with UTF8 coding using linq to entities
- Expression Tree with string assignment and getting value
- LINQ returning strange value using Select on a string
- Using LINQ to get all object with the same value property?
- Return record with max column value using Entity Framework 6
- Parsing a xml string & retrieving its attribute Value using Linq to XML C#
- Return list with more than one value stored in a dictionary using linq
- Dynamically build up a linq query with hierarchy using string field names?
- How can I combine IObservable<T>.Throttle() with some other event source using Reactive Extensions?
- Find an attribute that contains a ceratin string and modifying its Value in c# using LINQ
- LINQ to XML: filter a query using XElement.Attributes() collection with both XName and Value
- Translating query comprehension to Enumerable extension methods in LINQ
- linq nested group by
- Timeout exception running Linq Statement
- Search in a related Table with ASP.NET MVC3
- Rewriting LEFT JOIN sort of LINQ into generic LINQ
- Object does not contain "fullname" LINQ error
- using linq, update one node in an xml item
- Linq Query Join to Subquery with In clause
- Get Next Meeting Date fails using Linq query
- Using LINQ instead of using for-each loop
- Extension methods syntax for many to many relationship
- Check if a query contains things out of the list
- How can I use linq to initialize an array of repeated elements?
- LINQ to Entities Skip and Take
- How to use LINQ to CRM to populate Entity Readonly Fields (ModifiedOn, Createdby, etc)?
- LINQ LEFT JOIN where clause not working
- List of class properties
- How to load filtered child collection on child collections with a single database call?
- Displaying a photo in PictureBox from DB
- Select distinct using linq