Copied to clipboard

Flag this post as spam?

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


  • rasb 162 posts 218 karma points
    Mar 19, 2010 @ 23:46
    rasb
    0

    umbraco.editorControls.dropdown is empty

    Hi Guys,

    I bet this is a simple question. I am trying to render a dropdown in a member profile editor. But when I load the page and try to render the control the list of items seems to be empty. So I cannot set the selected value. When the control is done rendering the items are there.

    This is the code:

    String controlType = Member.GetCurrentMember().getProperty(propertyType).PropertyType.DataTypeDefinition.DataType.DataEditor.Editor.GetType().ToString();
    switch (controlType)
    {
    case "umbraco.editorControls.dropdown":
                        {
                            if (property.Value!=null)
                            {
                                ListItem li = ((dropdown)dataEditorControl).Items.FindByValue(property.Value.ToString());
                                if (li != null)
                                {
                                    int i = ((dropdown)dataEditorControl).Items.IndexOf(li);
                                    ((dropdown)dataEditorControl).SelectedIndex = i;
                                }
                            }
                        }
                        break;
    }

    My problem is just that at this point (in Page_Load) the Items collection is empty. I can see that the count property is 0. 

    Is there some sort of late binding, or can anyone else offer a clue as to what is happening.

    Thanks,
    RasB

  • rasb 162 posts 218 karma points
    Mar 20, 2010 @ 11:07
    rasb
    0

    I have tried doing this setting the selected value in the DataBound event without any luck.

    Any thoughts on this?

    Thanks,
    RasB

  • rasb 162 posts 218 karma points
    Mar 20, 2010 @ 14:23
    rasb
    0

    It turns out that my problem wasn't in my User Control at all.

    I was trying to set the values in the Umbraco Backend Member area, and it didn't save the values. I am using the latest build of Chrome for Windows XP 4.1.249.1036, and it just didn't save the values. I have seen incompatibilities with Chrome and the Umbraco Backend before, so I should have looked at that first...

    /RasB

Please Sign in or register to post replies

Write your reply to:

Draft