How to display a .NET bit value in Editor
How to display a .NET bit value in Editor
Hi,
I am using Editor with a SQL database that has a table with a column of type 'bit'. It stores 0 or 1 and represents true or false. The .Net editor object does not retrieve it although I have specified the column in the model object. I tried types int, string, bool, but the column is ignored by the editor object when data is retrieved in the controller`(other columns of type date, string and int work fine. What am I missing?
Thanks,
Bert-Jan
This question has an accepted answers - jump to answer
Answers
Hi,
Have you tried using the
radio
field type to display selectable options to the end user andcolumns.render
to display a human readable representation of the data in the table?Allan
Thanks,
finally got this to work. In the controller editor object I had to add :
I had expected it to work without specifically specifying the field, but that is not always the case..
Bert-Jan
One more question:
The radio button for updating works fine now but I haven't managed to get columns.render to work.
I looked at some examples but is is unclear to me how I should use the columns.render option to display 'travel' instead of 'true' and 'work' instead of 'false' in the datatable.
Can you point me to an example?
Thanks,
Bert-Jan
Never mind, got it to work: (In razor view with localized text)