Inheritance: System.Web.UI.WebControls.DataBoundControl, IEditableTextControl
Example #1
0
 public static void Fillchk(ListControl control, string key, string value, object data)
 {
     control.DataSource = data;
     control.DataValueField = key;
     control.DataTextField = value;
     control.DataBind();
 }
Example #2
0
 public McssWebQuestion(string strId, bool bRequired, string strRequiredText, string strQuestion, string strControlBase, RepeatDirection rdLayout, string[] strResponses)
     : base(strId, "mcss", bRequired, strRequiredText, strQuestion)
 {
     this.m_radioButtonList = new RadioButtonList();
     this.m_dropDownList = new DropDownList();
     this.m_listControl = null;
     if (strControlBase == "dropdown")
     {
         this.m_listControl = this.m_dropDownList;
     }
     else
     {
         this.m_radioButtonList.RepeatDirection = rdLayout;
         this.m_listControl = this.m_radioButtonList;
     }
     foreach (string text in strResponses)
     {
         this.m_listControl.Items.Add(new ListItem(text));
     }
     this.m_listControl.ID = "lst_" + strId;
     if (bRequired)
     {
         ListControlValidator child = new ListControlValidator();
         child.EnableClientScript = false;
         child.Text = strRequiredText;
         child.Display = ValidatorDisplay.Dynamic;
         child.ControlToValidate = this.m_listControl.ID;
         this.Controls.Add(child);
     }
     this.Controls.Add(this.m_listControl);
     this.Controls.Add(new LiteralControl("</p>"));
 }
Example #3
0
 public static void BindList(ListControl _ltControl, bool _bIncludeSel, bool _bIncludeAll)
 {
     if (null != _ltControl)
     {
         _ltControl.Items.Clear();
         if (_bIncludeAll)
         {
             _ltControl.Items.Add(new ListItem("--全部--", ""));
         }
         if (_bIncludeSel)
         {
             _ltControl.Items.Add(new ListItem("--请选择--", ""));
         }
         SystemOrganization[] alist = SystemOrganization.List();
         if (alist != null && alist.Length != 0)
         {
             SystemOrganization[] array = alist;
             for (int i = 0; i < array.Length; i++)
             {
                 SystemOrganization item = array[i];
                 ListItem li = new ListItem(item.Name, string.Concat(item.Id));
                 _ltControl.Items.Add(li);
             }
         }
     }
 }
Example #4
0
 public static void Flip(Label lbl, ListControl lst, bool blnReadOnly)
 {
     lbl.Visible = blnReadOnly;
     lst.Visible = !blnReadOnly;
     if (blnReadOnly)
     {
         lbl.Text = "";
         foreach (ListItem item in lst.Items)
         {
             if (item.Selected)
             {
                 lbl.Text = lbl.Text + "<br>" + item.Text;
             }
         }
         if (lbl.Text != "")
         {
             lbl.Text = lbl.Text.Remove(0, 4);
         }
     }
     else
     {
         string str = lbl.Text.Replace("<br>", ",");
         if (str != "")
         {
             foreach (string str2 in str.Split(new char[] { ',' }))
             {
                 SelectedByText(lst, str2);
             }
         }
     }
 }
 public static void FillRange(ListControl control, int min = 1, int max = 10)
 {
     control.DataSource = GetRange(min, max);
     control.DataValueField = "key";
     control.DataTextField = "value";
     control.DataBind();
 }
Example #6
0
 public static void Bind2Ddl(ListControl ddl, DataTable dt, string textField, string valueField)
 {
     ddl.DataSource = dt;
     ddl.DataTextField = textField;
     ddl.DataValueField = valueField;
     ddl.DataBind();
 }
Example #7
0
 public static void BindList(ListControl _ltControl, bool _bIncludeSel, bool _bIncludeAll, bool _bIncludeTip)
 {
     if (null != _ltControl)
     {
         _ltControl.Items.Clear();
         if (_bIncludeAll)
         {
             _ltControl.Items.Add(new ListItem("--全部--", ""));
         }
         if (_bIncludeSel)
         {
             _ltControl.Items.Add(new ListItem("--请选择--", ""));
         }
         SystemRole[] alist = SystemRole.List();
         if (alist != null && alist.Length != 0)
         {
             SystemRole[] array = alist;
             for (int i = 0; i < array.Length; i++)
             {
                 SystemRole item = array[i];
                 ListItem li = new ListItem(item.Name, string.Concat(item.Id));
                 if (_bIncludeTip)
                 {
                     li.Attributes["title"] = item.Description;
                 }
                 _ltControl.Items.Add(li);
             }
         }
     }
 }
Example #8
0
 // This function binds the given CheckBoxList with the given data table with respect to the data text field and the value field.
 public static void Bind2CheckBoxList(ListControl chk, DataTable dt, string textField, string valueField)
 {
     chk.DataSource = dt;
     chk.DataTextField = textField;
     chk.DataValueField = valueField;
     chk.DataBind();
 }
 /// <summary>
 /// Constructs a new list property binding for the given ListControl element.
 /// </summary>
 /// <param name="list">The list control to be bound to the data property.</param>
 protected ListPropertyBinding(ListControl list)
     : base(list)
 {
     bool isMultiVal = control is ListBox || control is CheckBoxList;
     // ListBox and CheckBoxList post values on selection change, since deselecting all has no post value
     // and we have to use selection change to detect this as opposed to no post at all
     if (isMultiVal)
     {
         PostedValue = null;
         list.SelectedIndexChanged += delegate
         {
             if (isMultiVal && property != null && control.Page != null)
             {
                 PostedValue = control.Page.Request.Form[control.UniqueID] ?? "";
                 // for CheckBoxList each item is posted individually, so we just reconstruct it
                 // from the selected item, since LoadPostData should have happened by now.
                 if (control is CheckBoxList)
                 {
                     List<string> newValues = new List<string>();
                     foreach (ListItem item in list.Items)
                         if (item.Selected && !newValues.Contains(item.Value)) newValues.Add(item.Value);
                     PostedValue = string.Join(",", newValues.ToArray());
                 }
                 UpdateProperty(PostedValue);
             }
         };
     }
 }
Example #10
0
        public new void PopulateListControl2(ListControl listControl)
        {
            var filterAttribute = Column.GetAttribute<FilterForeignKeyAttribute>();
               if (filterAttribute == null || Session[filterAttribute.SessionVariableName] == null)
               {
                    base.PopulateListControl(listControl);
                    return;
               }

               var context = Column.Table.CreateContext();
               var foreignKeyTable = ForeignKeyColumn.ParentTable;
               var filterColumn = foreignKeyTable.GetColumn(filterAttribute.FilterColumnName);
               var value = Convert.ChangeType(Session[filterAttribute.SessionVariableName].ToString(), filterColumn.TypeCode, CultureInfo.InvariantCulture);

               var query = foreignKeyTable.GetQuery(context); // Get Column Value query
               var entityParam = Expression.Parameter(foreignKeyTable.EntityType, foreignKeyTable.Name); // get the table entity to be filtered
               var property = Expression.Property(entityParam, filterColumn.Name); // get the property to be filtered
               var equalsCall = Expression.Equal(property, Expression.Constant(value)); // get the equal call
               var whereLambda = Expression.Lambda(equalsCall, entityParam); // get the where lambda
               var whereCall = Expression.Call(typeof(Queryable), "Where", new Type[] { foreignKeyTable.EntityType }, query.Expression, whereLambda); // get the where call
               var values = query.Provider.CreateQuery(whereCall);
               foreach (var row in values)
               {
                    listControl.Items.Add(new ListItem()
                    {
                         Text = foreignKeyTable.GetDisplayString(row),
                         Value = foreignKeyTable.GetPrimaryKeyString(row)
                    });
               }
        }
Example #11
0
 // This function binds the given RadioButtonList with the given data table with respect to the data text field and the value field.
 public static void Bind2RadioButtonList(ListControl rbl, DataTable dt, string textField, string valueField)
 {
     rbl.DataSource = dt;
     rbl.DataTextField = textField;
     rbl.DataValueField = valueField;
     rbl.DataBind();
 }
Example #12
0
        public static void AddListItems(ListControl control, string keys, string values, string selectedValues)
        {
            if (control == null)
            {
                return;
            }

            if (string.IsNullOrWhiteSpace(keys))
            {
                return;
            }

            if (string.IsNullOrWhiteSpace(values))
            {
                return;
            }

            var key = keys.Split(',');
            var value = values.Split(',');

            if (key.Count() != value.Count())
            {
                throw new InvalidOperationException("Key or value count mismatch. Cannot add items to " + control.ID);
            }

            for (var i = 0; i < key.Length; i++)
            {
                var item = new ListItem(key[i].Trim(), value[i].Trim());
                control.Items.Add(item);
            }

            foreach (ListItem item in control.Items)
            {
                //Checkbox list allows multiple selection.
                if (control is CheckBoxList)
                {
                    if (!string.IsNullOrWhiteSpace(selectedValues))
                    {
                        foreach (var selectedValue in selectedValues.Split(','))
                        {
                            if (item.Value.Trim().Equals(selectedValue.Trim()))
                            {
                                item.Selected = true;
                            }
                        }
                    }
                }
                else
                {
                    if (!string.IsNullOrWhiteSpace(selectedValues))
                    {
                        if (item.Value.Trim().Equals(selectedValues.Split(',').Last().Trim()))
                        {
                            item.Selected = true;
                            break;
                        }
                    }
                }
            }
        }
        /// <summary>
        /// Populate a ListControl with all the items in the foreign table
        /// </summary>
        /// <param name="listControl"></param>
        /// <param name="dataSource"></param>
        /// <parm name="valueField"></parm>
        /// <parm name="defaultTextField"></parm>
        protected void PopulateListControl(ListControl listControl, IQueryable dataSource, string valueField)
        {
            var filterdata = new List<KeyValuePair<string, string>>();
            string textField = string.Empty;

            if (dataSource != null)
            {
                if (_filterFields.ForeignText != string.Empty)
                {
                    if (CheckDropDownTextField(_filterFields.ForeignText, dataSource.ElementType)) {
                        textField = _filterFields.ForeignText;
                    }
                }

                if (textField == string.Empty) {
                    textField = FindDropDownTextField(Column.FieldName, dataSource.ElementType);
                }

                foreach (object dataItem in dataSource) {
                    filterdata.Add(new KeyValuePair<string, string>(DataBinder.GetPropertyValue(dataItem, textField, null), DataBinder.GetPropertyValue(dataItem, valueField, null)));
                }

                if (_filterFields.SortField == "Yes")
                {
                    if (_filterFields.SortDescending)
                        filterdata.Sort(CompareDesc);
                    else
                        filterdata.Sort(CompareAsc);
                }

                foreach (KeyValuePair<string, string> keyvalue in filterdata) {
                    listControl.Items.Add(new ListItem(keyvalue.Key, _filterFields.FieldName + ":" + keyvalue.Value));
                }
            }
        }
Example #14
0
 public McmsWebQuestion(string strId, bool bRequired, string strRequiredText, string strQuestion, string strControlBase, RepeatDirection rdLayout, string[] strResponses)
     : base(strId, "mcms", bRequired, strRequiredText, strQuestion)
 {
     this.m_listBox = new ListBox();
     this.m_checkBoxList = new CheckBoxList();
     this.m_listControl = null;
     if (strControlBase == "checkbox")
     {
         this.m_checkBoxList.RepeatDirection = rdLayout;
         this.m_listControl = this.m_checkBoxList;
     }
     else
     {
         this.m_listBox.SelectionMode = ListSelectionMode.Multiple;
         this.m_listControl = this.m_listBox;
     }
     foreach (string text in strResponses)
     {
         this.m_listControl.Items.Add(new ListItem(text));
     }
     this.m_listControl.ID = "lst_" + strId;
     this.Controls.Add(this.m_listControl);
     if (bRequired)
     {
         ListControlValidator child = new ListControlValidator();
         child.EnableClientScript = false;
         child.Text = strRequiredText;
         child.Display = ValidatorDisplay.Dynamic;
         child.ControlToValidate = this.m_listControl.ID;
         this.Controls.Add(child);
     }
     this.Controls.Add(new LiteralControl("</p>"));
 }
		public static string GetSelectedValue(ListControl ddl) {
			string sVal = null;
			if (ddl.SelectedItem != null) {
				sVal = ddl.SelectedValue;
			}
			return sVal;
		}
		public static int? GetSelectedInt(ListControl ddl) {
			int? iVal = null;
			if (ddl.SelectedItem != null) {
				iVal = int.Parse(ddl.SelectedValue);
			}
			return iVal;
		}
		public static Guid? GetSelectedGuid(ListControl ddl) {
			Guid? gVal = null;
			if (ddl.SelectedItem != null) {
				gVal = new Guid(ddl.SelectedValue);
			}
			return gVal;
		}
Example #18
0
 protected override object GetValue(ListControl ddl)
 {
     if (!string.IsNullOrEmpty(ddl.SelectedValue))
         return GetEnumValue(int.Parse(ddl.SelectedValue));
     else
         return null;
 }
Example #19
0
 public static void BindObject(ListControl ddl, DataTable data, string textColumn, string valueConlumn, string defaultText)
 {
     ddl.DataSource = data;
     ddl.DataTextField = textColumn;
     ddl.DataValueField = valueConlumn;
     ddl.DataBind();
     ddl.Items.Insert(0, new ListItem(defaultText, "-1"));
 }
Example #20
0
        private static Dictionary<string, Dictionary<int, string>> _EnumList = new Dictionary<string, Dictionary<int, string>>(); //枚举缓存池

        #endregion Fields

        #region Methods

        /// <summary>
        /// bind source for ListControl;ex:DropDown,ListBox;
        /// </summary>
        /// <param name="listControl"></param>
        /// <param name="enumType"></param>
        public static void BindListControl(ListControl listControl, Type enumType)
        {
            listControl.Items.Clear();
            listControl.DataSource = EnumToDictionary(enumType);
            listControl.DataValueField = "key";
            listControl.DataTextField = "value";
            listControl.DataBind();
        }
		public static void SetSelectedValues(ListControl ctl, string[] value)
		{
			foreach (ListItem li in ctl.Items)
				li.Selected = false;
	
			foreach (string val in value)
				ctl.Items.FindByValue(val).Selected = true;
		}
Example #22
0
        public static int GetListItemIndex(ListControl control, ListItem item)
        {
            int index = control.Items.IndexOf(item);
            if (index == -1)
                throw new NullReferenceException("ListItem does not exist ListControl.");

            return index;
        }
 public void GetSingleSelection(ListControl listControl)
 {
     if (listControl.SelectedIndex != -1)
     {
         Response.Write("Text = "+listControl.SelectedItem.Text+"<br/>");
         Response.Write("Value = " + listControl.SelectedValue.ToString() + "<br/>");
         Response.Write("Index = " + listControl.SelectedIndex.ToString() + "<br/>");
     }
 }
Example #24
0
        public static string GetListItemUniqueID(ListControl control, ListItem item)
        {
            if (control == null)
                throw new ArgumentNullException("Control can not be null.");

            int index = GetListItemIndex(control, item);

            return String.Format("{0}${1}", control.UniqueID, index.ToString());
        }
Example #25
0
        public static void BindToEnum(Type enumType, ListControl lc, bool addEmpty)
        {
            Dictionary<string, string> ht = EnumToDictionary(enumType, addEmpty);

            lc.DataSource = ht.OrderBy(x => x.Key);
            lc.DataTextField = "Key";
            lc.DataValueField = "Value";
            lc.DataBind();
        }
        private static void BindProcessStatus(ListControl control)
        {
            EnumItemDescriptionList statusDesp = EnumItemDescriptionAttribute.GetDescriptionList(typeof(WfProcessStatus));

            List<EnumItemDescription> list = statusDesp.ToList();

            control.BindData(list, "Name", "Description");
            control.Items.Insert(0, new ListItem(Translator.Translate("Workflow", "全部"), string.Empty));
        }
        public static void BindListDefaultText(ListControl ctrl, object dataSource, string SelectedValue, string EmptyChoiceText, string EmptyChoiceValue)
        {
            BindList(ctrl, dataSource);

            EmptyChoiceValue = String.IsNullOrEmpty(EmptyChoiceValue) ? "" : EmptyChoiceValue;
            ctrl.Items.Insert(0, new ListItem(String.Format("-{0}-", EmptyChoiceText), EmptyChoiceValue));

            SelectListValue(ctrl, SelectedValue);
        }
Example #28
0
 public static void SafeSelect(ListControl ddl, string val)
 {
     ListItem li = ddl.Items.FindByValue(val);
     if (li != null)
     {
         ddl.ClearSelection();
         li.Selected = true;
     }
 }
		public static string[] GetSelectedValues(ListControl ctl)
		{
			ArrayList al = new ArrayList();
			foreach (ListItem li in ctl.Items)
				if (li.Selected)
					al.Add(li.Value);
	
			return (string[]) CollectionUtils.ToArray(typeof(string), al);
		}
 protected override object GetValue(ListControl ddl)
 {
     return ddl
         .Items
         .Cast<ListItem>()
         .Where(li => li.Selected)
         .Select(li => int.Parse(li.Value))
         .ToList();
 }
Example #31
0
 public static void SetValueMultiple(System.Web.UI.WebControls.ListControl myListControl, string value)
 {
     AssemblingList.SetValueMultiple(myListControl, value);
 }
Example #32
0
 public static void SetListSchool(System.Web.UI.WebControls.ListControl myListControl, System.Web.UI.WebControls.ListControl myListControl2, List <NameValueList> myListData)
 {
     SetLists(myListControl, myListData);
     SetLists(myListControl2, myListData);
 }
Example #33
0
        public static void SetLists2(System.Web.UI.WebControls.ListControl myListControl, System.Web.UI.WebControls.ListControl myListControl2, string operate, string userID, string userRole, string schoolYear, string schoolCode)
        {
            // string sp = "dbo.tcdsb_LTO_ListDDLNew @Operate,@Para0,@Para1,@Para2,@Para3";
            List2Item parameter = new List2Item {
                Operate = "SchoolList", Para0 = userID, Para1 = userRole, Para2 = schoolYear, Para3 = schoolCode
            };

            SetLists2(myListControl, myListControl2, parameter);
        }
Example #34
0
 public static void SetLists3(System.Web.UI.WebControls.ListControl myListControl1, System.Web.UI.WebControls.ListControl myListControl2, System.Web.UI.WebControls.ListControl myListControl3, List2Item parameter, object initialValue)
 {
     SetLists3(myListControl1, myListControl2, myListControl3, parameter);
     SetValue(myListControl1, initialValue);
     SetValue(myListControl2, initialValue);
     SetValue(myListControl3, initialValue);
 }
Example #35
0
 public static void SetLists(System.Web.UI.WebControls.ListControl myListControl, List <NameValueList> myListData)
 {
     AssemblingMyList(myListControl, myListData, "Value", "Name");
 }
Example #36
0
 public static void SetLists(System.Web.UI.WebControls.ListControl myListControl, List <NameValueList> myListData, object initialValue)
 {
     SetLists(myListControl, myListData);
     SetValue(myListControl, initialValue);
 }
Example #37
0
        public static void SetLists(string JsonSource, System.Web.UI.WebControls.ListControl myListControl, string ddlType, CommonListParameter parameter)
        {
            List <NameValueList> myListData = ListDataSource(JsonSource, ddlType, parameter, "DDList");

            SetLists(myListControl, myListData);
        }
Example #38
0
 public static void SetLists(string JsonSource, System.Web.UI.WebControls.ListControl myListControl, string ddlType, CommonListParameter parameter, object initialValue)
 {
     SetLists(JsonSource, myListControl, ddlType, parameter);
     SetValue(myListControl, initialValue);
 }
Example #39
0
 public static void SetListSchool(System.Web.UI.WebControls.ListControl myListControl1, System.Web.UI.WebControls.ListControl myListControl2, string ddlType, CommonListParameter parameter, object initialValue)
 {
     SetListSchool(myListControl1, myListControl2, ddlType, parameter);
     SetValue(myListControl1, initialValue);
     SetValue(myListControl2, initialValue);
 }
Example #40
0
 public static void SetListsFromJson(System.Web.UI.WebControls.ListControl myListControl, string ddlType, string JsonFile, object initialValue)
 {
     SetListsFromJson(myListControl, ddlType, JsonFile);
     SetValue(myListControl, initialValue);
 }
Example #41
0
        //public static ListItemCollection SelectedItems(this ListControl listControl)
        //{
        //    var colSelectedListItems = new ListItemCollection();

        //    //foreach (var item in listControl.Items)
        //    //{
        //    //    if (item.Selected)
        //    //    {
        //    //        colSelectedListItems.Add(item);
        //    //    }
        //    //}

        //    foreach (var item in listControl.Items.Cast<ListItem>().Where((item) => item.Selected))
        //    {
        //        colSelectedListItems.Add(item);
        //    }
        //    return colSelectedListItems;
        //}

        public static IEnumerable <ListItem> SelectedItems(this ListControl listControl)
        {
            return(listControl.Items.Cast <ListItem>().Where((item) => item.Selected));//.Select((item) => item);
        }
Example #42
0
 public static void SetListsFromJson(System.Web.UI.WebControls.ListControl myListControl, string ddlType, string JsonFile)
 {
     AssemblingMyListJson(myListControl, JsonFileReader.GetNvList(JsonFile, ddlType)); //GetListDataFromJson(ddlType, JsonFile));
 }
Example #43
0
 public static IEnumerable <String> SelectedTexts(this ListControl listControl)
 {
     return(listControl.Items.Cast <ListItem>().Where((item) => item.Selected).Select((item) => item.Text));
 }
Example #44
0
        public static void SetLists3(System.Web.UI.WebControls.ListControl myListControl1, System.Web.UI.WebControls.ListControl myListControl2, System.Web.UI.WebControls.ListControl myListControl3, object parameter)
        {
            string           sp     = "dbo.tcdsb_LTO_ListSchoolPrincipalsNew @Operate, @Para0, @Para1, @Para2, @Para3";
            List <List2Item> myList = GeneralDataAccess.GetListofTypeT <List2Item>(sp, parameter);

            AssemblingMyList(myListControl1, myList, "myValue", "myText"); // school Code DDL
            AssemblingMyList(myListControl2, myList, "myValue", "myText"); // school Code DDL
            AssemblingMyList(myListControl3, myList, "myValue", "myText"); // school Code DDL
        }
Example #45
0
 public static void SetLists(System.Web.UI.WebControls.ListControl myListControl, string ddlType, List2Item parameter, object initialValue)
 {
     SetLists(myListControl, ddlType, parameter);
     SetValue(myListControl, initialValue);
 }
Example #46
0
        private static void AssemblingSchoolList(System.Web.UI.WebControls.ListControl myListControl, System.Web.UI.WebControls.ListControl myListControl2, List <List2Item> myList)
        {
            try
            {
                List <List2Item> myList2 = myList.OrderBy(o => o.MyValue).ToList();
                AssemblingMyList(myListControl, myList2, "myValue", "myValue"); // school Code DDL

                AssemblingMyList(myListControl2, myList, "myValue", "myText");  // School Name DDL
            }
            catch (Exception ex)
            { var em = ex.Message; }
            finally
            { }
        }
Example #47
0
 private static void AssemblingSchoolList(System.Web.UI.WebControls.ListControl myListControl1, System.Web.UI.WebControls.ListControl myListControl2, List <ListSchool> myList)
 {
     try
     {
         List <ListSchool> sortedList = myList.OrderBy(o => o.Code).ToList();
         AssemblingMyList(myListControl1, sortedList, "Code", "Code"); // school Code DDL
         AssemblingMyList(myListControl2, myList, "Code", "Name");     // School Name DDL
     }
     catch (Exception ex)
     { var em = ex.Message; }
     finally
     { }
 }
Example #48
0
        public static void SetLists2(System.Web.UI.WebControls.ListControl myListControl, System.Web.UI.WebControls.ListControl myListControl2, object parameter)
        {
            string           sp         = "dbo.tcdsb_LTO_ListSchoolsNew  @Operate, @Para0, @Para1, @Para2, @Para3";
            List <List2Item> myListData = GeneralDataAccess.GetListofTypeT <List2Item>(sp, parameter);

            AssemblingSchoolList(myListControl, myListControl2, myListData);
        }
Example #49
0
        public static void SetListSchool(System.Web.UI.WebControls.ListControl myListControl1, System.Web.UI.WebControls.ListControl myListControl2, string ddlType, List2Item parameter)
        {
            List <ListSchool> myListData = GeneralExe.SchoolList(parameter); // CommonListExecute.GetSchoolListData(parameter);

            AssemblingSchoolList(myListControl1, myListControl2, myListData);
        }
Example #50
0
 private static void AssemblingSchoolList(System.Web.UI.WebControls.ListControl myListControl1, System.Web.UI.WebControls.ListControl myListControl2, List <NameValueList> myList)
 {
     try
     {
         var byList = myList.OrderBy(o => o.Value);
         //var sList = from c in myList
         //             orderby c.Code
         //             select c;
         AssemblingMyList(myListControl2, myList, "Value", "Name");  // School Name DDL
         AssemblingMyList(myListControl1, byList, "Value", "Value"); // school Code DDL
         myListControl2.SelectedIndex = 0;
         SetValue(myListControl1, myListControl2.SelectedValue);
     }
     catch (Exception ex)
     { var em = ex.Message; }
     finally
     { }
 }
Example #51
0
        public static void SetLists(string JsonSource, System.Web.UI.WebControls.ListControl myListControl, string ddlType, List2Item parameter)
        {
            List <NvListItem> myListData = ListDataSource(JsonSource, ddlType, parameter);

            AssemblingMyList(myListControl, myListData, "Value", "Name");
        }
Example #52
0
        public static void SetListSchool(System.Web.UI.WebControls.ListControl myListControl1, System.Web.UI.WebControls.ListControl myListControl2, string ddlType, CommonListParameter parameter)
        {
            //  string SP = SPandParameters.GetSPNameAndParameters("General", "Schools");

            List <NameValueList> myListData = ListDataSource("", ddlType, parameter, "DDLListSchool");  // CommonExcute<CommonList>.ListOfT(SP, parameter);

            AssemblingSchoolList(myListControl1, myListControl2, myListData);
        }
Example #53
0
 public static void SetValue(System.Web.UI.WebControls.ListControl myListControl, object objectValue)
 {
     AssemblingList.SetValue(myListControl, objectValue);
 }