Answered by:
[UIHint("XXX")] in a Partials.cs doesn't work. (It is not possible to change Field types)

Question
-
User116907111 posted
Hello,
I have a partials class and make the following settings:
[DisplayName("Certified")]
[UIHint("MultilineText_Edit")]
public object Certified{ get; set; } The Displayname works well.
The MultilineText_Edit Box is shown in the list_view but not in the Insert or Update View. My Question is: What must I do, that the MultilineText_Edit Box is on my Insert/Update.aspx pages?Can anybody explain what I make wrong?
Regards,
BKFriday, October 31, 2008 8:43 AM
Answers
-
User-1005219520 posted
Hi BK,
I think you want
[UIHint("MultilineText")]
not[UIHint("MultilineText_Edit")]
as[UIHint("MultilineText")]
gives you the expected behavior.- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Friday, October 31, 2008 1:58 PM
All replies
-
User660823006 posted
I'm assuming in your case you have a regular VARCHAR(XX) or NVARCHAR(XX) column that you are trying to show with multiline_edit? If your column in the database is a NVARCHAR(MAX) or NTEXT we will automatically show the Multiline_Text field template for those columns in Insert/Edit mode but not in the List mode. To do that in the List mode you need to override our default control selection using a custom FieldGenerator. I'll try the UI hint against a non-blob column and see what behavior I get.
Friday, October 31, 2008 12:22 PM -
User-1005219520 posted
Hi BK,
I have reproduced this problem using the AdventureWorksLT DB - using the Customer table.
[MetadataType(typeof(CustomerMetaData))] public partial class Customer { public class CustomerMetaData { [DisplayName("Certified Sales Person")] [UIHint("MultilineText_Edit")] public object SalesPerson { get; set; } [ScaffoldColumn(false)] public object PasswordHash { get; set; } } }
The MultilineText_Edit Box is shown in the list , Details but not in the Edit. Is that what you are seeing? This looks like a bug, I'll confirm and report back.
Friday, October 31, 2008 1:47 PM -
User-1005219520 posted
Hi BK,
I think you want
[UIHint("MultilineText")]
not[UIHint("MultilineText_Edit")]
as[UIHint("MultilineText")]
gives you the expected behavior.- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Friday, October 31, 2008 1:58 PM -
User-1005219520 posted
[delete dup]
Friday, October 31, 2008 1:58 PM -
User-330204900 posted
<STRIKE>Hi BK, if it is showing up on the List page then it should show up ont he Insert/Edit pages, what is the DB type of the field in questiona nd I will setup a test to see what happens [:D]</STRIKE>
Scrap that Rick got there before me [:(]
Friday, October 31, 2008 2:01 PM -
User-330204900 posted
I think you want
[UIHint("MultilineText")]
not[UIHint("MultilineText_Edit")]
Yep that makes sense, otherwise when you edit it will look for a FieldTempalte called MultilineText_Edit_Edit for Edit and Insert pages [:D]
Friday, October 31, 2008 5:12 PM -
User116907111 posted
Thanks at all! It works :-)
Tuesday, November 4, 2008 4:09 AM