So dropdowns matter / text. The value is what I store in my database (as the primary key to the table that displays the value / text displayed in the drop-down list). When I fill in my folder, I use the value / text. When the user selects it, it saves the value (numeric) in the transaction table. This means that when I read it back to my model, I have a numerical value, not text. However, after 24 hours of selection, I only need to display the text, since they cannot make changes. The problem is that it displays the value (1, 2, 3, 4) instead of the actual text, which will make more sense to people.
Is there a way to convert this at the presentation level? The reason I ask is because my template is disabled and acts like a display template and an editor template, since this is the functionality required on the page. Therefore, I easily show the selected value in the editor template section with:
@Html.DropDownListFor(modelItem => item.RecordType, new SelectList(Model.RecordTypes, "RECORD_TYPE_ID", "RECORD_TYPE", item.RecordType)
but the display section has:
@Html.DisplayFor(modelItem => item.RecordType)
Which gives me the value number, not the text. Do I really need to make another field in my view model and fill in the text as well as the value on the record? As you can see from DropDownListFor (), I have a RecordTypes list that stores the value / text, so can I use this value to search for text and display it from the template view via DisplayFor () or something else?