Esempio n. 1
0
        public MvcHtmlString AvailableItems(IDictionary <string, object> htmlAttributes = null)
        {
            List <ExtendedSelectListItem> NotSelected = new List <ExtendedSelectListItem>();

            foreach (ExtendedSelectListItem sel in allItems)
            {
                if (!valuesSet.Contains(sel.Value))
                {
                    NotSelected.Add(sel);
                }
            }
            if (htmlAttributes == null)
            {
                htmlAttributes = new Dictionary <string, object>();
            }
            htmlAttributes["data-elementispart"] = "true";
            return(MvcHtmlString.Create
                   (

                       CurrHtmlHelper.DropDownbase <TModel, TChoiceItem, TDisplay, TValue>(
                           BasicHtmlHelper.AddField(Prefix, "$.PackedValue") + DualSelect_SelectAvial,
                           new List <TValue>() as IEnumerable <TValue>,
                           NotSelected,
                           htmlAttributes,
                           true,
                           false).ToString()
                   ));
        }
Esempio n. 2
0
        public MvcHtmlString SelectedItems(IDictionary <string, object> htmlAttributes = null)
        {
            List <ExtendedSelectListItem> selected = new List <ExtendedSelectListItem>();

            foreach (TValue val in Value)
            {
                if (allItemsDictionary.ContainsKey(val.ToString()))
                {
                    selected.Add(allItemsDictionary[val.ToString()]);
                }
            }
            if (htmlAttributes == null)
            {
                htmlAttributes = new Dictionary <string, object>();
            }
            htmlAttributes["data-elementispart"] = "true";
            return(MvcHtmlString.Create
                   (
                       RenderPackedList() +
                       CurrHtmlHelper.DropDownbase <TModel, TChoiceItem, TDisplay, TValue> (
                           BasicHtmlHelper.AddField(Prefix, "$.PackedValue") + DualSelect_SelectSelected,
                           new List <TValue>() as IEnumerable <TValue>,
                           selected,
                           htmlAttributes,
                           true,
                           false).ToString()
                   ));
        }