Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Chad Rosenthal 272 posts 474 karma points
    Sep 28, 2010 @ 16:29
    Chad Rosenthal
    0

    Insert a checklist using c#

    Umbraco 4.5.2

    I'm creating a document using c#. The document is created and I can view it in the CMS. The problem is that I have a checklist in my usercontrol that I'm trying to save into a Checklist Datatype. Doesn't seem to want to take the values.

    Is this possible?

    Below is the code that I use to create the currentVideo.WordsToDescribeVideo. Benath that is the code that I use to input it into the document.

                        foreach (ListItem li in cblWords.Items)
                        {
                            if (li.Selected)
                            {
                                if (selectedWords.Length > 0)
                                {
                                    selectedWords += ", ";
                                }
    
                                selectedWords += li.Text;
                            }
                        }            
    newDoc.getProperty("checkListName").Value = currentVideo.WordsToDescribeVideo; 
  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Sep 28, 2010 @ 16:51
    Sebastiaan Janssen
    0

    You might need to insert the id's of the checklist items instead of the values (the id's are visible in the datatype's list). Not sure if the comma's need the extra space after them either.

  • Paul Griffiths 370 posts 1021 karma points
    Feb 12, 2014 @ 13:49
    Paul Griffiths
    0

    Hi Chad did you manage to get this working?

    Im doing something very similar where I have a user control and I want the user to be able to select options through a check box list control and then i want to update the node (also Check box list data type) with the selected values

    any help would be great ;)

    Thanks Paul

Please Sign in or register to post replies

Write your reply to:

Draft