protected override WebControl CreateEditModeControlCore() { var editModeControlCore = base.CreateEditModeControlCore(); ListBoxTemplate.PostValue = false; var values = ((IEnumerable <object>)PropertyValue).Select(wrapper => wrapper.ToString()); var value = string.Join(ListBoxTemplate.SeparatorChar.ToString(CultureInfo.InvariantCulture), values); ListBoxTemplate.SetValue(value); foreach (var value1 in values) { ListBoxTemplate.Items.FindByText(value1).Selected = true; } Control.Value = value; return(editModeControlCore); }
protected override WebControl CreateEditModeControlCore() { var editModeControlCore = base.CreateEditModeControlCore(); ListBoxTemplate.PostValue = false; var value = GetPropertyDisplayValue(); ListBoxTemplate.SetValue(value); if (!string.IsNullOrEmpty(value)) { foreach (var value1 in ((IEnumerable <object>)PropertyValue).Select(wrapper => wrapper.ToString()).ToArray()) { ListBoxTemplate.Items.FindByText(value1).Selected = true; } } Control.Value = value; return(editModeControlCore); }