Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I believe the problem is MvcScaffolding does not know what property is supposed to represent your text field. The templates try to find a candidate property in the class that it thinks may represent a column that would have a value representative of the "text" property. I've seen the code and it looks for things like "Name", "Title" and etc. If it finds one of those it will use that field for the text property. Here is the actual code it uses:</p> <p><code>static string[] displayPropertyNames = new[] { "Name", "Title", "LastName", "Surname", "Subject", "Count" };</code></p> <p>It will use the first one it finds and if it doesn't find any at all you get the code you have currently. This is not ideal because you may not have either of those names and/or you may have a field with one of those names but may not want it representing the text value in the drop down.</p> <p>The other option that is supposed to address this concern is creating a partial class and attaching a DisplayColumn attribute on the model type you are binding to the drop down. For example: </p> <p><code>[DisplayColumn("LocationName")] public partial class DropDownBoundType {}</code></p> <p>What I have found however is the implementation of a partial class is causing some other issues where the MvcScaffolding generator stops recognizing fields as association keys. So instead of having drop downs it produces text boxes in some cases. Not sure what the issue is yet and maybe it won't affect you but unfortunately that is the behavior I am getting so tread cautiously.</p> <p>Also I noticed you were running 9.7 and there is a new version available 9.8. I don't think it addresses your issue but it addresses some others. It may be worth your time to go ahead and update it.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload