Esempio n. 1
0
        protected void OnWidgetFilterChanged(object sender, EventArgs e)
        {
            List <int> groupIds = new List <int>();

            foreach (ListItem item in ((CheckBoxList)sender).Items)
            {
                if (item.Selected)
                {
                    groupIds.Add(int.Parse(item.Value));
                }
            }
            WG.DataSource = widgets.FindAll(x => groupIds.Contains(x.GroupId));
            WG.DataBind();
        }
Esempio n. 2
0
        private void LoadData()
        {
            var groupIds = (from widget in widgets select widget.GroupId).Distinct();

            CblWidgets.Items.Clear();
            foreach (int groupId in groupIds)
            {
                CblWidgets.Items.Add(new ListItem()
                {
                    Text = (new TextControl()
                    {
                        LanguageFile = "UserControls.WebUI.Base", TextKey = "LableWidgetGroup" + groupId
                    }).Text, Value = groupId.ToString(), Selected = true
                });
            }

            WG.DataSource = widgets;
            WG.DataBind();
        }