Reputation: 26121
I have List of strings (List) as a ContentItem property. Which editor should I use to add/edit/delete list items in the editor interface? Please let me know if there are some examples available. I am new to N2 and don't really have an idea at the moment to create my own editor.
Upvotes: 0
Views: 157
Reputation: 3236
You can persist this as just a string in the database. In the getter & setter, you would do something like:
List<string> MyProperty {
get { return new List<string>(GetValue<string>("MyProperty", String.Empty).Split("\n"); }
set { SetValue<string>(String.Join("\n", value.ToArray()), String.Empty); }
}
Note: I wrote this off the top of my head so the String.Join parameters might be reversed.
Upvotes: 0