Copied to clipboard

Flag this post as spam?

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


  • Moran 277 posts 885 karma points
    Oct 30, 2013 @ 10:07
    Moran
    0

    using checkboxlist with members

    I am trying to create a property for selecting members using Checkboxlist control in a usercontrol wrapper. the problem is I don't know how to save the user selection and read it later from the DB.

    This is a sample I made using a simple text box, now I need to figure out how to achieve this in a checkboxlist.

     public object value
        {
            get
            {
                return MemberTextBox.Text;
            }
            set
            {
                if (value != null)
                {
                    MemberTextBox.Text = value.ToString();
                }
            }
        }
    
  • Hendy Racher 861 posts 3844 karma points MVP 2x admin c-trib
    Oct 30, 2013 @ 10:27
    Hendy Racher
    0

    Hi Moran,

    I wonder if the built-in datatype XPath CheckBoxList would be suitable for your purpose ? it can be configured with an XPath expression to select those members that should become selectable options.

    HTH,

    Hendy

  • Moran 277 posts 885 karma points
    Oct 30, 2013 @ 10:38
    Moran
    0

    Hi I think this can do the trick, but for some reason I can't see the type section in my settings, I am using umbraco version 4.11.8 enter image description here

  • Hendy Racher 861 posts 3844 karma points MVP 2x admin c-trib
    Oct 30, 2013 @ 11:11
    Hendy Racher
    100

    Arhh, that's a shame, unfortunately I can't remember which version of Umbraco this datatype was updated.

    Another option may be to use the uComponents SQL CheckBoxList with something like:

    SELECT [text] AS 'Text',
           id AS 'Value' 
    FROM   cmsMember
    LEFT OUTER JOIN umbracoNode ON id = nodeId
    

     

  • Moran 277 posts 885 karma points
    Oct 30, 2013 @ 12:01
    Moran
    1

    Works like a charm thanks :)

  • Hendy Racher 861 posts 3844 karma points MVP 2x admin c-trib
    Oct 30, 2013 @ 12:07
    Hendy Racher
    0

    excellent, that's good to hear :)

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies