page form set multiple choice checkboxes

Scott Beveridge asked on July 16, 2015 21:35

I have pages with multiple choice select box form fields. I am trying to select more than one value for a field, but can't find how to do this via the api. if (!DataHelper.DataSourceIsEmpty(catinfo)) { foreach (DataRow row in catinfo.Tables[0].Rows) { string catname = ValidationHelper.GetString(row["CategoryDisplayName"], null); var node = cats.Where(x => x.DocumentName == catname).SingleOrDefault(); if (node != null) { Literal1.Text += productdoc.DocumentName + "
" + catname + "
"; productdoc.SetValue("Regions", node.NodeGUID.ToString());//HERE - IF THERE ARE MULTIPLE CATEGORIES HOW DO I SET MANY? productdoc.Update(); } } } Literal1.Text += "

"; } } } catch (Exception ex) { Literal1.Text = ex.ToString(); } } }

Recent Answers


Roman Hutnyk answered on July 17, 2015 21:49

Scott,

Kentico saves multiple values in one column in the following format, unless you specify other:

value1|value2|value3

Why wouldn't you try to format your values like the above?!

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.