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.
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...
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:
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
I have tried doing this setting the selected value in the DataBound event without any luck.
Any thoughts on this?
Thanks,
RasB
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
is working on a reply...