Example #1
0
 /// <summary>
 ///     This method will be called when the ListBox should
 ///     be scrolled to the given index
 /// </summary>
 /// <param name="listBox">The ListBox which should be scrolled</param>
 /// <param name="index">The index of the item to which it should be scrolled</param>
 public static void OnAutoScrollToCurrentItem(RadListBox listBox, int index)
 {
     if (listBox?.Items != null && listBox.Items.Count > index && index >= 0)
     {
         listBox.ScrollIntoView(listBox.Items[index]);
     }
 }
Example #2
0
    private static void ShowCheckedItems(RadListBox listBox, Label label)
    {
        try
        {
            StringBuilder          sb         = new StringBuilder();
            IList <RadListBoxItem> collection = listBox.CheckedItems;

            foreach (RadListBoxItem item in collection)
            {
                if (sb.Length == 0)
                {
                    sb.Append(item.Value);
                }
                else
                {
                    sb.Append("," + item.Value);
                }
            }

            label.Text = sb.ToString();
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(HttpContext.Current.Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Jobs", ex.StackTrace, DateTime.Now);
            HttpContext.Current.Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
Example #3
0
        public void DragStart(DragInfo info)
        {
            if (info.SourceItem == null)
            {
                info.Cancelled = true;
                return;
            }
            RadListBox rlb = info.Source as RadListBox;

            if (rlb != null)
            {
                //设置拖拽窗口视觉效果。
                IEnumerable <RadListBoxItem> items = rlb.FindVisualChildren <RadListBoxItem>();
                foreach (RadListBoxItem item in items)
                {
                    if (item.DataContext.Equals(rlb.SelectedItem))
                    {
                        rlb.SetValue(DragDropVisual.VisualProperty, item);
                        break;
                    }
                }
                SearchNodeHistoryViewModel searchVM = rlb.DataContext as SearchNodeHistoryViewModel;
                if (searchVM == null || searchVM.SelectedVideo == null)
                {//如果没有选中项,或者选中项不是视频节点,取消拖拽。
                    info.Cancelled = true;
                }
            }
        }
Example #4
0
        protected void rgFieldTrips_InsertCommand(object sender, GridCommandEventArgs e)
        {
            GridEditableItem item = e.Item as GridEditableItem;

            Data.Trip newTrip = new Data.Trip();

            newTrip.office_id = Convert.ToInt32((item.FindControl("rddlOffice") as RadDropDownList).SelectedValue);
            newTrip.user_id   = (item.FindControl("rddlAssignedTo2") as RadDropDownList).SelectedValue.ToString();
            newTrip.trip_nm   = (item.FindControl("rtbTripName2") as RadTextBox).Text;
            RadListBox assigned_sites = (item.FindControl("rlbSitesEnd2") as RadListBox);

            db.Trips.InsertOnSubmit(newTrip);
            db.SubmitChanges();

            List <Data.TripSite> tripSites = new List <Data.TripSite>();

            foreach (RadListBoxItem site in assigned_sites.Items)
            {
                tripSites.Add(new Data.TripSite()
                {
                    trip_id = newTrip.trip_id, site_id = Convert.ToInt32(site.Value)
                });
            }
            db.TripSites.InsertAllOnSubmit(tripSites);
            db.SubmitChanges();

            DisplayMessage(false, "The field trip was added!");
        }
Example #5
0
        protected void rgFieldTrips_UpdateCommand(object sender, GridCommandEventArgs e)
        {
            GridEditableItem item = e.Item as GridEditableItem;

            int trip_id  = Convert.ToInt32(item.GetDataKeyValue("trip_id"));
            var currTrip = db.Trips.FirstOrDefault(p => p.trip_id == trip_id);

            string     trip_nm        = (item.FindControl("rtbTripName") as RadTextBox).Text;
            string     assigned_to    = (item.FindControl("rddlAssignedTo") as RadDropDownList).SelectedValue.ToString();
            RadListBox assigned_sites = (item.FindControl("rlbSitesEnd") as RadListBox);

            currTrip.trip_nm = trip_nm;
            currTrip.user_id = assigned_to;
            db.TripSites.DeleteAllOnSubmit(currTrip.TripSites);
            db.SubmitChanges();

            List <Data.TripSite> tripSites = new List <Data.TripSite>();

            foreach (RadListBoxItem site in assigned_sites.Items)
            {
                tripSites.Add(new Data.TripSite()
                {
                    trip_id = currTrip.trip_id, site_id = Convert.ToInt32(site.Value)
                });
            }
            db.TripSites.InsertAllOnSubmit(tripSites);
            db.SubmitChanges();

            DisplayMessage(false, "The field trip's info was updated!");
        }
Example #6
0
 protected void CargarLista(string pClContenedor, RadListBox pLista)
 {
     pLista.DataSource     = vPlantilla.LST_CAMPOS.Where(w => w.CL_CONTENEDOR == pClContenedor).OrderBy(o => o.NO_ORDEN);//.Select(s => new RadListBoxItem(s.NB_CAMPO, s.ID_CAMPO.ToString()));
     pLista.DataValueField = "ID_CAMPO";
     pLista.DataTextField  = "NB_CAMPO";
     pLista.DataBind();
 }
Example #7
0
    protected void rcbCarriers_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
    {
        RadComboBox      combobox = (RadComboBox)sender;
        GridEditFormItem edititem = (GridEditFormItem)combobox.NamingContainer;

        RadTextBox rtb = (RadTextBox)edititem.FindControl("txtCageType");

        RadListBox rlbFrom = (RadListBox)edititem.FindControl("RadListBoxFrom");
        RadListBox rlbTo   = (RadListBox)edititem.FindControl("RadListBoxTo");

        Label      lblCageType = (Label)edititem.FindControl("lblCageType");
        RadTextBox txtCageType = (RadTextBox)edititem.FindControl("txtCageType");

        rlbFrom.Items.Clear();
        if (combobox.SelectedValue == "-1")
        {
            rlbFrom.Items.Clear();
        }
        else
        {
            CagetypeServiceDAO cts        = new CagetypeServiceDAO();
            DataTable          dtServices = cts.GetCarrierServices(combobox.SelectedValue).Tables[0];

            foreach (DataRow dr in dtServices.Rows)
            {
                rlbFrom.Items.Add(new RadListBoxItem(dr["carrier_service_descr"] as string, dr["carrier_service_id"] as string));
            }
        }
    }
Example #8
0
 /// <summary>
 /// 绑定数据
 /// </summary>
 /// <param name="box"></param>
 /// <param name="dataSource"></param>
 /// <param name="textField"></param>
 /// <param name="valueField"></param>
 public static void BindData(RadListBox box, object dataSource, string textField, string valueField)
 {
     box.DataSource     = dataSource;
     box.DataTextField  = textField;
     box.DataValueField = valueField;
     box.DataBind();
 }
Example #9
0
        protected void rcbCriteriaType_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
        {
            RadComboBox      combobox = (RadComboBox)sender;
            GridEditFormItem edititem = (GridEditFormItem)combobox.NamingContainer;

            RadListBox rlbFrom = (RadListBox)edititem.FindControl("RadListBoxFrom");
            RadListBox rlbTo   = (RadListBox)edititem.FindControl("RadListBoxTo");

            Label lblStoreDeliveryGroup = (Label)edititem.FindControl("lblStoreDeliveryGroup");

            rlbFrom.Items.Clear();
            rlbTo.Items.Clear();
            StoreDelivCriteriaDAO storeDelivCriteria  = new StoreDelivCriteriaDAO();
            DataTable             dtAvailableCriteria = storeDelivCriteria.GetAvailableStoreDelivCriteriaByType(lblStoreDeliveryGroup.Text, combobox.Text).Tables[0];
            DataTable             dtCriteria          = storeDelivCriteria.GetStoreDelivCriteriaByType(lblStoreDeliveryGroup.Text, combobox.Text).Tables[0];

            foreach (DataRow dr in dtAvailableCriteria.Rows)
            {
                rlbFrom.Items.Add(new RadListBoxItem(dr["crit_value"] as string, dr["crit_code"] as string));
            }

            foreach (DataRow dr in dtCriteria.Rows)
            {
                rlbTo.Items.Add(new RadListBoxItem(dr["crit_value"] as string, dr["crit_code"] as string));
            }
        }
Example #10
0
 protected void chkSelectAll_CheckedChanged(object sender, EventArgs e)
 {
     try
     {
         RadListBox chk = new RadListBox();
         if (chkcheckall.Checked)
         {
             for (int index = 0; index < RLB_Colums.Items.Count; index++)
             {
                 RLB_Colums.Items[index].Checked = true;
             }
         }
         else
         {
             for (int index = 0; index < RLB_Colums.Items.Count; index++)
             {
                 RLB_Colums.Items[index].Checked = false;
             }
         }
     }
     catch (Exception ex)
     {
         SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "Dynamic", ex.StackTrace, DateTime.Now);
         Response.Redirect("~/Frm_ErrorPage.aspx");
     }
 }
 /// <summary>
 ///
 /// </summary>
 /// <param name="rlbObject"></param>
 /// <param name="objSource"></param>
 /// <param name="valueColumn"></param>
 /// <param name="textColumn"></param>
 internal static void LlenarLB(RadListBox rlbObject, DataTable objSource, string valueColumn, string textColumn)
 {
     rlbObject.Items.Clear();
     rlbObject.DataSource     = objSource;
     rlbObject.DataValueField = valueColumn;
     rlbObject.DataTextField  = textColumn;
     rlbObject.DataBind();
 }
        private void agregarItemLista(RadListBox lista, RadTextBox cajaTexto)
        {
            RadListBoxItem item = new RadListBoxItem();

            item.Value = cajaTexto.Text;
            item.Text  = cajaTexto.Text;
            lista.Items.Add(item);
        }
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();
            this.newItemsControl      = this.GetTemplateChild("newItemsList") as RadListBox;
            this.structureTreeControl = this.GetTemplateChild("PART_StructureTree") as RadTreeView;

            this.UpdateNewItemsTemplate(this.NewItemsTemplate);
            this.UpdateStructureItemsTemplate(this.StructureItemsTemplate);
        }
Example #14
0
 /// <summary>
 /// 设置选中的值
 /// </summary>
 /// <param name="box"></param>
 /// <param name="item">值</param>
 public static RadListBoxItem SetSelected(this RadListBox box, RadListBoxItem item)
 {
     if (item != null)
     {
         box.ClearSelection();
         item.Selected = true;
     }
     return(item);
 }
Example #15
0
        void box_Dropping(object sender, RadListBoxDroppingEventArgs e)
        {
            RadListBox box = sender as RadListBox;

            if (e.HtmlElementID != box.ClientID)
            {
                IsTransferring = true;
            }
        }
Example #16
0
        //NO LONGER BEING USED - So that all sites, regardless of office, are available to be assigned to a field trip
        protected void rddlOffice_SelectedIndexChanged(object source, EventArgs e)
        {
            RadDropDownList        rddl = (RadDropDownList)source;
            GridEditFormInsertItem item = (GridEditFormInsertItem)rddl.NamingContainer;
            RadListBox             rlb  = (RadListBox)item.FindControl("rlbSitesStart2");

            int office_id = Convert.ToInt32(rddl.SelectedValue);

            rlb.DataSource = Sites.Where(p => p.office_id == office_id);
            rlb.DataBind();
        }
Example #17
0
 /// <summary>
 /// 绑定RadListBox的排序/拖动/移动/删除命令
 /// </summary>
 /// <param name="sourceBox"></param>
 /// <param name="destBox"></param>
 public RadListBoxCommandBinder(RadListBox sourceBox, RadListBox destBox)
 {
     if (!sourceBox.Page.IsPostBack)
     {
         sourceBox.TransferToID = destBox.ID;
     }
     this.sourceBox = sourceBox;
     this.destBox   = destBox;
     this.Init(sourceBox, true);
     this.Init(destBox, false);
 }
Example #18
0
 public void CargaItemsRadList(RadListBox listbox, string ids)
 {
     listbox.ClearChecked();
     if (ids != "")
     {
         foreach (string id in ids.Split(",".ToCharArray()))
         {
             listbox.FindItemByValue(id).Checked = true;
         }
     }
 }
        private void ShowDetailBonus(string typeBonus, RadListBox listBox)
        {
            var main     = ServiceLocator.Current.GetInstance <MainViewModel>();
            var template = main.SelectedTemplate;

            if (listBox != null)
            {
                var item = (StatModel)listBox.SelectedItem;
                template.ShowDetailBonus(typeBonus, item.Stat.Code);
            }
        }
 /// <summary>
 /// Res the set selected items.
 /// </summary>
 /// <param name="listBox">The list box.</param>
 private static void ReSetSelectedItems(RadListBox listBox)
 {
     IList selectedItems = GetListBoxSelectedItems(listBox);
     if (selectedItems != null) {
         selectedItems.Clear();
         if (listBox.SelectedItems != null) {
             foreach (var item in listBox.SelectedItems) {
                 selectedItems.Add(item);
             }
         }
     }
 }
Example #21
0
        public List <string> GetSelectedMenus(RadListBox menuList)
        {
            List <string> checkedMenulist = new List <string>();

            IList <RadListBoxItem> collection = menuList.CheckedItems;

            foreach (RadListBoxItem item in collection)
            {
                checkedMenulist.Add(item.DataKey.ToString());
            }
            return(checkedMenulist);
        }
Example #22
0
    protected void CageTypesRadGrid_UpdateCommand(object sender, GridCommandEventArgs e)
    {
        Label       txtCageType           = (Label)e.Item.FindControl("lblCageType");
        RadTextBox  txtCageTypeDescr      = (RadTextBox)e.Item.FindControl("txtCageTypeDescr");
        RadComboBox rcbCarrier            = (RadComboBox)e.Item.FindControl("rcbCarriers");
        RadComboBox rcbCntryGrps          = (RadComboBox)e.Item.FindControl("rcbCntryGrps");
        CheckBox    cbDespatchableInd     = (CheckBox)e.Item.FindControl("cbDespatchableInd");
        RadComboBox rcbStoreDeliveryGroup = (RadComboBox)e.Item.FindControl("rcbStoreDeliveryGroup");

        if (txtCageType.Text.Length > 0 && txtCageTypeDescr.Text.Length > 0 && rcbCarrier.SelectedValue != "-1")
        {
            try
            {
                string cageType           = txtCageType.Text;
                string cageTypeDescr      = txtCageTypeDescr.Text;
                string carrierID          = rcbCarrier.SelectedValue;
                string userLogin          = User.Identity.Name;
                string carrierGrpId       = rcbCntryGrps.SelectedValue == "-1" ? "" : rcbCntryGrps.SelectedValue;
                string despatchableInd    = cbDespatchableInd.Checked == true ? "T" : "F";
                Int64? storeDeliveryGroup = Int64.Parse(rcbStoreDeliveryGroup.SelectedValue);
                if (storeDeliveryGroup < 0)
                {
                    storeDeliveryGroup = null;
                }

                CagetypeDAO cage = new CagetypeDAO();
                cage.UpdateCageTypeDetails(cageType.ToUpper(), cageTypeDescr, carrierID, carrierGrpId, despatchableInd, storeDeliveryGroup, userLogin);

                RadListBox rlbTo   = (RadListBox)e.Item.FindControl("RadListBoxTo");
                RadListBox rlbFrom = (RadListBox)e.Item.FindControl("RadListBoxFrom");

                CagetypeServiceDAO cageservice = new CagetypeServiceDAO();

                foreach (RadListBoxItem rlbItem in rlbFrom.Items)
                {
                    cageservice.RemvoveServiceToCageType(cageType.ToUpper(), rlbItem.Value, User.Identity.Name);
                }

                foreach (RadListBoxItem rlbItem in rlbTo.Items)
                {
                    cageservice.AddServiceToCageType(cageType.ToUpper(), rlbItem.Value, User.Identity.Name);
                }
                DisplayMessage(false, "Cage Type " + cageType + " updated");
                CageTypesRadGrid.Rebind();
            }
            catch (Exception ex)
            {
                string messageline = ex.Message.Split('\n')[0].Substring(10);
                DisplayMessage(true, messageline);
            }
        }
    }
Example #23
0
        protected void gvChildCode_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if ((e.Item is GridEditFormItem) && (e.Item.IsInEditMode))
            {
                RadListBox chkbldepart = new RadListBox();
                if (e.Item is GridEditFormInsertItem && e.Item.OwnerTableView.IsItemInserted)
                {
                    GridEditFormInsertItem item = (GridEditFormInsertItem)e.Item;
                    TextBox txtChildCode        = (TextBox)item.FindControl("txtChildCode");
                    chkbldepart = (RadListBox)item.FindControl("chkbldepart");
                }
                if (e.Item is GridDataItem)
                {
                    GridDataItem dataItem     = e.Item as GridDataItem;
                    LinkButton   buttonEdit   = dataItem["editColumn"].Controls[0] as LinkButton;
                    LinkButton   buttonDelete = dataItem["deleteColumn"].Controls[0] as LinkButton;
                    //chkbldepart = dataItem["chkbldepart"].Controls[0] as RadListBox;
                }

                if (e.Item is GridEditFormItem && e.Item.IsInEditMode && e.Item.ItemIndex != -1)
                {
                    string           strExtType = gvChildCode.MasterTableView.DataKeyValues[e.Item.ItemIndex]["AAC_AgentCode"].ToString();
                    GridEditFormItem editedItem = (GridEditFormItem)e.Item;
                    chkbldepart = (RadListBox)e.Item.FindControl("chkbldepart");
                }
                DataSet dsDepartmentlist = new DataSet();
                dsDepartmentlist = associatesBo.GetDepartment(advisorVo.advisorId);
                int       departmentId  = Convert.ToInt32(dsDepartmentlist.Tables[0].Rows[0]["AD_DepartmentId"].ToString());
                DataTable dtBindAdvisor = new DataTable();
                dtBindAdvisor              = advisorStaffBo.GetUserRoleDepartmentWise(departmentId, advisorVo.advisorId);
                chkbldepart.DataSource     = dtBindAdvisor;
                chkbldepart.DataTextField  = dtBindAdvisor.Columns["AR_Role"].ToString();
                chkbldepart.DataValueField = dtBindAdvisor.Columns["AR_RoleId"].ToString();
                chkbldepart.DataBind();
                if (e.Item.RowIndex != -1)
                {
                    string   roleIds = gvChildCode.MasterTableView.DataKeyValues[e.Item.ItemIndex]["RoleIds"].ToString();
                    string[] RoleIds = roleIds.Split(',');
                    for (int i = 0; i < RoleIds.Length; i++)
                    {
                        foreach (RadListBoxItem li in chkbldepart.Items)
                        {
                            if (RoleIds[i] == li.Value.ToString())
                            {
                                li.Checked = true;
                            }
                        }
                    }
                }
            }
        }
Example #24
0
        void box_Dropped(object sender, RadListBoxDroppedEventArgs e)
        {
            RadListBox box = sender as RadListBox;

            if (e.HtmlElementID != box.ClientID)
            {
                ChangeItemsDisabled(e.SourceDragItems);
                IsTransferring = false;
            }
            else
            {
                ChangeItesOrder(box.Items);
            }
        }
Example #25
0
 /// <summary>
 /// 绑定数据
 /// </summary>
 /// <param name="box"></param>
 /// <param name="dataSource">数据源</param>
 /// <param name="textfld">文本字段</param>
 /// <param name="valuefld">值字段</param>
 public static RadListBox BindData(this RadListBox box, object dataSource, string textfld, string valuefld)
 {
     if (box.SelectedIndex > -1)
     {
         box.ClearSelection();
     }
     if (box.Items.Count > 0)
     {
         box.Items.Clear();
     }
     box.DataSource     = dataSource;
     box.DataTextField  = textfld;
     box.DataValueField = valuefld;
     box.DataBind();
     return(box);
 }
Example #26
0
        public void DragEnd(DragInfo info)
        {
            if (info.SourceItem == null)
            {
                return;
            }
            RadListBox rlb = info.Source as RadListBox;

            if (rlb != null)
            {
                SearchNodeHistoryViewModel searchVM = rlb.DataContext as SearchNodeHistoryViewModel;
                if (searchVM != null)
                {
                    searchVM.SelectedVideo = null;
                }
            }
        }
Example #27
0
        protected void StoreDelivGroupsRadGrid_UpdateCommand(object sender, GridCommandEventArgs e)
        {
            Label       txtStoreDeliveryGroup      = (Label)e.Item.FindControl("lblStoreDeliveryGroup");
            RadTextBox  txtStoreDeliveryGroupName  = (RadTextBox)e.Item.FindControl("txtStoreDeliveryGroupName");
            RadTextBox  txtStoreDeliveryGroupDescr = (RadTextBox)e.Item.FindControl("txtStoreDeliveryGroupDescr");
            RadComboBox txtCriteriaType            = (RadComboBox)e.Item.FindControl("rcbCriteriaType");

            if (txtStoreDeliveryGroupName.Text.Length > 0 && txtStoreDeliveryGroupDescr.Text.Length > 0)
            {
                try
                {
                    Int64  storeDeliveryGroupId    = Int64.Parse(txtStoreDeliveryGroup.Text);
                    string storeDeliveryGroupName  = txtStoreDeliveryGroupName.Text;
                    string storeDeliveryGroupDescr = txtStoreDeliveryGroupDescr.Text;
                    string criterionTypeCode       = txtCriteriaType.Text;
                    Int64? storeDelivGrpMapId      = 0;

                    StoreDelivGrpDAO storeDelivGrp = new StoreDelivGrpDAO();
                    storeDelivGrp.UpdateStoreDeliveryGroupTypeDetails(storeDeliveryGroupId, storeDeliveryGroupName.ToUpper(), storeDeliveryGroupDescr);

                    RadListBox rlbTo   = (RadListBox)e.Item.FindControl("RadListBoxTo");
                    RadListBox rlbFrom = (RadListBox)e.Item.FindControl("RadListBoxFrom");

                    StoreDelivCriteriaDAO storeDelivCriteria = new StoreDelivCriteriaDAO();

                    foreach (RadListBoxItem rlbItem in rlbFrom.Items)
                    {
                        storeDelivCriteria.RemoveCriteriaFromGroup(storeDeliveryGroupId, criterionTypeCode, rlbItem.Value);
                    }

                    foreach (RadListBoxItem rlbItem in rlbTo.Items)
                    {
                        storeDelivCriteria.AddCriteriaToGroup(storeDelivGrpMapId, storeDeliveryGroupId, criterionTypeCode, rlbItem.Value);
                    }

                    DisplayMessage(false, "Store delivery group " + storeDeliveryGroupName + " updated");
                    StoreDelivGroupsRadGrid.Rebind();
                }
                catch (Exception ex)
                {
                    string messageline = ex.Message.Split('\n')[0].Substring(10);
                    DisplayMessage(true, messageline);
                }
            }
        }
Example #28
0
        public void DragEnd(DragInfo info)
        {
            if (_dragStartIndex < 0)
            {
                return;
            }
            RadListBox rlb = info.Source as RadListBox;

            if (rlb != null)
            {
                TimeSwitchViewModel vm = rlb.DataContext as TimeSwitchViewModel;
                if (vm != null)
                {
                    vm.ToDropPlan(_dragStartIndex);
                }
                _dragStartIndex = -1;
            }
        }
Example #29
0
        public void DragStart(DragInfo info)
        {
            if (info.SourceItem == null || info.EventOriginalSource is TextBox)
            {
                info.Cancelled = true;
                return;
            }
            RadListBox rlb = info.Source as RadListBox;

            if (rlb != null)
            {
                //设置拖拽窗口视觉效果。
                IEnumerable <RadListBoxItem> items = rlb.FindVisualChildren <RadListBoxItem>();
                foreach (RadListBoxItem item in items)
                {
                    if (item.DataContext.Equals(rlb.SelectedItem))
                    {
                        ContentPresenter cp = item.FindVisualChild <ContentPresenter>();
                        if (cp != null)
                        {
                            rlb.SetValue(DragDropVisual.VisualProperty, cp);
                        }
                        else
                        {
                            rlb.SetValue(DragDropVisual.VisualProperty, item);
                        }
                        break;
                    }
                }

                TimeSwitchViewModel vm = rlb.DataContext as TimeSwitchViewModel;
                //如果没有选中项,或者选中项不是有效节点,取消拖拽。
                if (!(vm != null && vm.SelectedPlan != null && vm.SelectedPlan != TimeSwitchViewModel.AddPlanStatic))
                {
                    info.Cancelled = true;
                }
                else if (vm != null && vm.SelectedPlan != null)
                {
                    var list = vm.PlansSource.Source as ObservableCollection <LayoutPlanModel>;
                    _dragStartIndex = list.IndexOf(vm.SelectedPlan);
                    vm.ToDragPlan();
                }
            }
        }
Example #30
0
        public List <string> GetUnselectedMenus(RadListBox menuList)
        {
            List <string> uncheckedMenulist = new List <string>();

            IList <RadListBoxItem> collection  = menuList.Items;
            IList <RadListBoxItem> checkedlist = menuList.CheckedItems;

            foreach (RadListBoxItem item in collection)
            {
                foreach (RadListBoxItem checkeditem in checkedlist)
                {
                    if (item != checkeditem)
                    {
                        uncheckedMenulist.Add(item.DataKey.ToString());
                    }
                }
            }
            return(uncheckedMenulist.Distinct().ToList());
        }
Example #31
0
        string GetItemResult(RadListBox box)
        {
            var builder = new StringBuilder();

            builder.Append("(");
            builder.Append(box.ID);
            if (box.SelectedItem != null)
            {
                builder.Append("  Text:");
                builder.Append(box.SelectedItem.Text);
            }
            if (box.SelectedIndex > -1)
            {
                builder.Append("  Value:");
                builder.Append(box.SelectedValue);
            }
            builder.Append(")");
            return(builder.ToString());
        }
Example #32
0
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
     Telerik.WinControls.ThemeSource themeSource1 = new Telerik.WinControls.ThemeSource();
     Telerik.WinControls.ThemeSource themeSource2 = new Telerik.WinControls.ThemeSource();
     this.mainMenu1 = new System.Windows.Forms.MainMenu(this.components);
     this.menuItem1 = new System.Windows.Forms.MenuItem();
     this.menuItem6 = new System.Windows.Forms.MenuItem();
     this.lMovieMenu = new System.Windows.Forms.MenuItem();
     this.menuItem9 = new System.Windows.Forms.MenuItem();
     this.menuItemAddfilter = new System.Windows.Forms.MenuItem();
     this.menuItem5 = new System.Windows.Forms.MenuItem();
     this.menuItemGenre = new System.Windows.Forms.MenuItem();
     this.menuItemYear = new System.Windows.Forms.MenuItem();
     this.menuItemImdb = new System.Windows.Forms.MenuItem();
     this.menuItemMpaa = new System.Windows.Forms.MenuItem();
     this.menuItemRuntime = new System.Windows.Forms.MenuItem();
     this.menuItem22 = new System.Windows.Forms.MenuItem();
     this.menuItemMovielist = new System.Windows.Forms.MenuItem();
     this.menuItemDescription = new System.Windows.Forms.MenuItem();
     this.menuItemMovietitle = new System.Windows.Forms.MenuItem();
     this.menuItemPoster = new System.Windows.Forms.MenuItem();
     this.menuItemFanart = new System.Windows.Forms.MenuItem();
     this.menuItem21 = new System.Windows.Forms.MenuItem();
     this.menuItemFilterbutton = new System.Windows.Forms.MenuItem();
     this.menuItemTrailerbutton = new System.Windows.Forms.MenuItem();
     this.menuItemPlaybutton = new System.Windows.Forms.MenuItem();
     this.menuItem26 = new System.Windows.Forms.MenuItem();
     this.menuItemFullscreen = new System.Windows.Forms.MenuItem();
     this.menuItem10 = new System.Windows.Forms.MenuItem();
     this.menuItem3 = new System.Windows.Forms.MenuItem();
     this.menuItem4 = new System.Windows.Forms.MenuItem();
     this.menuItem2 = new System.Windows.Forms.MenuItem();
     this.panel1 = new System.Windows.Forms.Panel();
     this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
     this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
     this.button5 = new System.Windows.Forms.Button();
     this.button6 = new System.Windows.Forms.Button();
     this.label3 = new System.Windows.Forms.Label();
     this.label4 = new System.Windows.Forms.Label();
     this.label5 = new System.Windows.Forms.Label();
     this.label6 = new System.Windows.Forms.Label();
     this.label7 = new System.Windows.Forms.Label();
     this.label13 = new System.Windows.Forms.Label();
     this.pictureBox1 = new System.Windows.Forms.PictureBox();
     this.listBox1 = new Telerik.WinControls.UI.RadListBox();
     this.label9 = new System.Windows.Forms.Label();
     this.splitter1 = new System.Windows.Forms.Splitter();
     this.imageList1 = new System.Windows.Forms.ImageList(this.components);
     this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
     this.radListBoxItem5 = new Telerik.WinControls.UI.RadListBoxItem();
     this.radThemeManager1 = new Telerik.WinControls.RadThemeManager();
     this.panel1.SuspendLayout();
     this.tableLayoutPanel1.SuspendLayout();
     this.tableLayoutPanel2.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.listBox1)).BeginInit();
     this.SuspendLayout();
     //
     // mainMenu1
     //
     this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
     this.menuItem1,
     this.menuItem9,
     this.menuItem5,
     this.menuItem10});
     //
     // menuItem1
     //
     this.menuItem1.Index = 0;
     this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
     this.menuItem6,
     this.lMovieMenu});
     this.menuItem1.Text = "&Movie Lists";
     //
     // menuItem6
     //
     this.menuItem6.Index = 0;
     this.menuItem6.Text = "Add Lists";
     this.menuItem6.Click += new System.EventHandler(this.menuItem6_Click);
     //
     // lMovieMenu
     //
     this.lMovieMenu.Index = 1;
     this.lMovieMenu.Text = "Load Movies";
     this.lMovieMenu.Click += new System.EventHandler(this.lMovieMenu_Click);
     //
     // menuItem9
     //
     this.menuItem9.Index = 1;
     this.menuItem9.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
     this.menuItemAddfilter});
     this.menuItem9.Text = "&Filters";
     //
     // menuItemAddfilter
     //
     this.menuItemAddfilter.Index = 0;
     this.menuItemAddfilter.Text = "Add Filter";
     this.menuItemAddfilter.Click += new System.EventHandler(this.menuItem10_Click);
     //
     // menuItem5
     //
     this.menuItem5.Index = 2;
     this.menuItem5.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
     this.menuItemGenre,
     this.menuItemYear,
     this.menuItemImdb,
     this.menuItemMpaa,
     this.menuItemRuntime,
     this.menuItem22,
     this.menuItemMovielist,
     this.menuItemDescription,
     this.menuItemMovietitle,
     this.menuItemPoster,
     this.menuItemFanart,
     this.menuItem21,
     this.menuItemFilterbutton,
     this.menuItemTrailerbutton,
     this.menuItemPlaybutton,
     this.menuItem26,
     this.menuItemFullscreen});
     this.menuItem5.Text = "&Show";
     //
     // menuItemGenre
     //
     this.menuItemGenre.Checked = true;
     this.menuItemGenre.Index = 0;
     this.menuItemGenre.Text = "Genre";
     this.menuItemGenre.Click += new System.EventHandler(this.menuItemGenre_Click);
     //
     // menuItemYear
     //
     this.menuItemYear.Checked = true;
     this.menuItemYear.Index = 1;
     this.menuItemYear.Text = "Year";
     this.menuItemYear.Click += new System.EventHandler(this.menuItemYear_Click);
     //
     // menuItemImdb
     //
     this.menuItemImdb.Checked = true;
     this.menuItemImdb.Index = 2;
     this.menuItemImdb.Text = "Imdb Rating";
     this.menuItemImdb.Click += new System.EventHandler(this.menuItemImdb_Click);
     //
     // menuItemMpaa
     //
     this.menuItemMpaa.Checked = true;
     this.menuItemMpaa.Index = 3;
     this.menuItemMpaa.Text = "MPAA";
     this.menuItemMpaa.Click += new System.EventHandler(this.menuItemMpaa_Click);
     //
     // menuItemRuntime
     //
     this.menuItemRuntime.Checked = true;
     this.menuItemRuntime.Index = 4;
     this.menuItemRuntime.Text = "Run Time";
     this.menuItemRuntime.Click += new System.EventHandler(this.menuItemRuntime_Click);
     //
     // menuItem22
     //
     this.menuItem22.Checked = true;
     this.menuItem22.Index = 5;
     this.menuItem22.Text = "-";
     //
     // menuItemMovielist
     //
     this.menuItemMovielist.Checked = true;
     this.menuItemMovielist.Index = 6;
     this.menuItemMovielist.Text = "Movie List";
     this.menuItemMovielist.Click += new System.EventHandler(this.menuItemMovielist_Click);
     //
     // menuItemDescription
     //
     this.menuItemDescription.Checked = true;
     this.menuItemDescription.Index = 7;
     this.menuItemDescription.Text = "Description";
     this.menuItemDescription.Click += new System.EventHandler(this.menuItemDescription_Click);
     //
     // menuItemMovietitle
     //
     this.menuItemMovietitle.Checked = true;
     this.menuItemMovietitle.Index = 8;
     this.menuItemMovietitle.Text = "Movie Title";
     this.menuItemMovietitle.Click += new System.EventHandler(this.menuItemMovietitle_Click);
     //
     // menuItemPoster
     //
     this.menuItemPoster.Checked = true;
     this.menuItemPoster.Index = 9;
     this.menuItemPoster.Text = "Poster";
     this.menuItemPoster.Click += new System.EventHandler(this.menuItemPoster_Click);
     //
     // menuItemFanart
     //
     this.menuItemFanart.Checked = true;
     this.menuItemFanart.Index = 10;
     this.menuItemFanart.Text = "Fanart";
     this.menuItemFanart.Click += new System.EventHandler(this.menuItemFanart_Click);
     //
     // menuItem21
     //
     this.menuItem21.Checked = true;
     this.menuItem21.Index = 11;
     this.menuItem21.Text = "-";
     //
     // menuItemFilterbutton
     //
     this.menuItemFilterbutton.Checked = true;
     this.menuItemFilterbutton.Index = 12;
     this.menuItemFilterbutton.Text = "Filter List Button";
     //
     // menuItemTrailerbutton
     //
     this.menuItemTrailerbutton.Checked = true;
     this.menuItemTrailerbutton.Index = 13;
     this.menuItemTrailerbutton.Text = "Trailer Button";
     this.menuItemTrailerbutton.Click += new System.EventHandler(this.menuItemTrailerbutton_Click);
     //
     // menuItemPlaybutton
     //
     this.menuItemPlaybutton.Checked = true;
     this.menuItemPlaybutton.Index = 14;
     this.menuItemPlaybutton.Text = "Play Button";
     this.menuItemPlaybutton.Click += new System.EventHandler(this.menuItemPlaybutton_Click);
     //
     // menuItem26
     //
     this.menuItem26.Checked = true;
     this.menuItem26.Index = 15;
     this.menuItem26.Text = "-";
     //
     // menuItemFullscreen
     //
     this.menuItemFullscreen.Checked = true;
     this.menuItemFullscreen.Index = 16;
     this.menuItemFullscreen.Text = "Full Screen";
     this.menuItemFullscreen.Click += new System.EventHandler(this.menuItemFullscreen_Click_2);
     //
     // menuItem10
     //
     this.menuItem10.Index = 3;
     this.menuItem10.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
     this.menuItem3,
     this.menuItem4,
     this.menuItem2});
     this.menuItem10.Text = "&Program";
     //
     // menuItem3
     //
     this.menuItem3.Index = 0;
     this.menuItem3.Text = "Help";
     //
     // menuItem4
     //
     this.menuItem4.Index = 1;
     this.menuItem4.Text = "About";
     this.menuItem4.Click += new System.EventHandler(this.menuItem4_Click);
     //
     // menuItem2
     //
     this.menuItem2.Index = 2;
     this.menuItem2.Text = "Exit";
     this.menuItem2.Click += new System.EventHandler(this.menuItem2_Click);
     //
     // panel1
     //
     this.panel1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
     this.panel1.Controls.Add(this.tableLayoutPanel1);
     this.panel1.Controls.Add(this.splitter1);
     this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
     this.panel1.Location = new System.Drawing.Point(0, 0);
     this.panel1.Name = "panel1";
     this.panel1.Size = new System.Drawing.Size(792, 508);
     this.panel1.TabIndex = 0;
     //
     // tableLayoutPanel1
     //
     this.tableLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
     this.tableLayoutPanel1.BackColor = System.Drawing.Color.Transparent;
     this.tableLayoutPanel1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("tableLayoutPanel1.BackgroundImage")));
     this.tableLayoutPanel1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
     this.tableLayoutPanel1.ColumnCount = 20;
     this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 5.313812F));
     this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 4.287086F));
     this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 30.92826F));
     this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 5.620539F));
     this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 6.897242F));
     this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 1.605868F));
     this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 47F));
     this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 67F));
     this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 76F));
     this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 81F));
     this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 96F));
     this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 2F));
     this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 2F));
     this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 2F));
     this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 2F));
     this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 18.65864F));
     this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 1.658545F));
     this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 22.61749F));
     this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 2.412533F));
     this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 76F));
     this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel2, 0, 9);
     this.tableLayoutPanel1.Controls.Add(this.pictureBox1, 15, 2);
     this.tableLayoutPanel1.Controls.Add(this.listBox1, 0, 0);
     this.tableLayoutPanel1.Controls.Add(this.label9, 11, 1);
     this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
     this.tableLayoutPanel1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 0);
     this.tableLayoutPanel1.Name = "tableLayoutPanel1";
     this.tableLayoutPanel1.RowCount = 14;
     this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 3.068731F));
     this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 4.727844F));
     this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 5.318823F));
     this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 17F));
     this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 40.08499F));
     this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 4.330494F));
     this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 4.330494F));
     this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 4.330494F));
     this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.336759F));
     this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 3.474998F));
     this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 4.864631F));
     this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 11.13427F));
     this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 5.977489F));
     this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 2.019979F));
     this.tableLayoutPanel1.Size = new System.Drawing.Size(789, 508);
     this.tableLayoutPanel1.TabIndex = 19;
     //
     // tableLayoutPanel2
     //
     this.tableLayoutPanel2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
     this.tableLayoutPanel2.ColumnCount = 11;
     this.tableLayoutPanel1.SetColumnSpan(this.tableLayoutPanel2, 20);
     this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 1.202044F));
     this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 1.068483F));
     this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20.28803F));
     this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 18.43133F));
     this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 127F));
     this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 17.36285F));
     this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10.66271F));
     this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 1.199555F));
     this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 13.86152F));
     this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 13.82025F));
     this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 2.10322F));
     this.tableLayoutPanel2.Controls.Add(this.button5, 8, 8);
     this.tableLayoutPanel2.Controls.Add(this.button6, 9, 8);
     this.tableLayoutPanel2.Controls.Add(this.label3, 2, 1);
     this.tableLayoutPanel2.Controls.Add(this.label4, 5, 8);
     this.tableLayoutPanel2.Controls.Add(this.label5, 6, 8);
     this.tableLayoutPanel2.Controls.Add(this.label6, 2, 8);
     this.tableLayoutPanel2.Controls.Add(this.label7, 3, 8);
     this.tableLayoutPanel2.Controls.Add(this.label13, 4, 8);
     this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
     this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 371);
     this.tableLayoutPanel2.Margin = new System.Windows.Forms.Padding(0);
     this.tableLayoutPanel2.Name = "tableLayoutPanel2";
     this.tableLayoutPanel2.RowCount = 10;
     this.tableLayoutPanel1.SetRowSpan(this.tableLayoutPanel2, 5);
     this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 14.15831F));
     this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 14.12559F));
     this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 11.91199F));
     this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 11.91199F));
     this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 11.91199F));
     this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 11.91199F));
     this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 6.685027F));
     this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 4.861838F));
     this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 9.723677F));
     this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 2.797579F));
     this.tableLayoutPanel2.Size = new System.Drawing.Size(789, 137);
     this.tableLayoutPanel2.TabIndex = 31;
     //
     // button5
     //
     this.button5.Dock = System.Windows.Forms.DockStyle.Fill;
     this.button5.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.button5.Location = new System.Drawing.Point(591, 120);
     this.button5.Name = "button5";
     this.tableLayoutPanel2.SetRowSpan(this.button5, 2);
     this.button5.Size = new System.Drawing.Size(85, 14);
     this.button5.TabIndex = 27;
     this.button5.Text = "Play &Movie";
     this.button5.UseVisualStyleBackColor = true;
     this.button5.Click += new System.EventHandler(this.button5_Click);
     //
     // button6
     //
     this.button6.Dock = System.Windows.Forms.DockStyle.Fill;
     this.button6.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.button6.Location = new System.Drawing.Point(682, 120);
     this.button6.Name = "button6";
     this.tableLayoutPanel2.SetRowSpan(this.button6, 2);
     this.button6.Size = new System.Drawing.Size(85, 14);
     this.button6.TabIndex = 28;
     this.button6.Text = "Play &Trailer";
     this.button6.UseVisualStyleBackColor = true;
     this.button6.Click += new System.EventHandler(this.button6_Click);
     //
     // label3
     //
     this.label3.AutoSize = true;
     this.tableLayoutPanel2.SetColumnSpan(this.label3, 8);
     this.label3.Dock = System.Windows.Forms.DockStyle.Fill;
     this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.label3.ForeColor = System.Drawing.SystemColors.HotTrack;
     this.label3.Location = new System.Drawing.Point(17, 19);
     this.label3.Name = "label3";
     this.tableLayoutPanel2.SetRowSpan(this.label3, 6);
     this.label3.Size = new System.Drawing.Size(750, 92);
     this.label3.TabIndex = 22;
     this.label3.Text = "Movie Description";
     this.label3.UseCompatibleTextRendering = true;
     //
     // label4
     //
     this.label4.AutoSize = true;
     this.label4.Dock = System.Windows.Forms.DockStyle.Fill;
     this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.label4.Location = new System.Drawing.Point(400, 117);
     this.label4.Name = "label4";
     this.label4.Size = new System.Drawing.Size(108, 13);
     this.label4.TabIndex = 23;
     this.label4.Text = "mpaa";
     //
     // label5
     //
     this.label5.AutoSize = true;
     this.label5.Dock = System.Windows.Forms.DockStyle.Fill;
     this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.label5.Location = new System.Drawing.Point(514, 117);
     this.label5.Name = "label5";
     this.label5.Size = new System.Drawing.Size(64, 13);
     this.label5.TabIndex = 25;
     this.label5.Text = "runtime";
     //
     // label6
     //
     this.label6.AutoSize = true;
     this.label6.Dock = System.Windows.Forms.DockStyle.Fill;
     this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.label6.Location = new System.Drawing.Point(17, 117);
     this.label6.Name = "label6";
     this.label6.Size = new System.Drawing.Size(128, 13);
     this.label6.TabIndex = 26;
     this.label6.Text = "Genera";
     //
     // label7
     //
     this.label7.AutoSize = true;
     this.label7.Dock = System.Windows.Forms.DockStyle.Fill;
     this.label7.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.label7.Location = new System.Drawing.Point(151, 117);
     this.label7.Name = "label7";
     this.label7.Size = new System.Drawing.Size(116, 13);
     this.label7.TabIndex = 24;
     this.label7.Text = "year";
     //
     // label13
     //
     this.label13.AutoSize = true;
     this.label13.Dock = System.Windows.Forms.DockStyle.Fill;
     this.label13.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.label13.Location = new System.Drawing.Point(273, 117);
     this.label13.Name = "label13";
     this.label13.Size = new System.Drawing.Size(121, 13);
     this.label13.TabIndex = 32;
     this.label13.Text = "imdb stars";
     //
     // pictureBox1
     //
     this.tableLayoutPanel1.SetColumnSpan(this.pictureBox1, 3);
     this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill;
     this.pictureBox1.Location = new System.Drawing.Point(559, 41);
     this.pictureBox1.Name = "pictureBox1";
     this.tableLayoutPanel1.SetRowSpan(this.pictureBox1, 7);
     this.pictureBox1.Size = new System.Drawing.Size(138, 327);
     this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
     this.pictureBox1.TabIndex = 20;
     this.pictureBox1.TabStop = false;
     //
     // listBox1
     //
     this.listBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
     this.tableLayoutPanel1.SetColumnSpan(this.listBox1, 11);
     this.listBox1.Dock = System.Windows.Forms.DockStyle.Fill;
     this.listBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.listBox1.FormattingEnabled = true;
     this.listBox1.Location = new System.Drawing.Point(0, 0);
     this.listBox1.Margin = new System.Windows.Forms.Padding(0);
     this.listBox1.Name = "listBox1";
     this.tableLayoutPanel1.SetRowSpan(this.listBox1, 9);
     this.listBox1.ShowItemToolTips = false;
     this.listBox1.Size = new System.Drawing.Size(548, 371);
     this.listBox1.Sorted = Telerik.WinControls.Enumerations.SortStyle.Ascending;
     this.listBox1.TabIndex = 25;
     this.listBox1.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged_1);
     ((Telerik.WinControls.UI.RadListBoxElement)(this.listBox1.GetChildAt(0))).SortItems = Telerik.WinControls.Enumerations.SortStyle.Ascending;
     ((Telerik.WinControls.Primitives.BorderPrimitive)(this.listBox1.GetChildAt(0).GetChildAt(1))).Visibility = Telerik.WinControls.ElementVisibility.Hidden;
     //
     // label9
     //
     this.label9.AutoSize = true;
     this.tableLayoutPanel1.SetColumnSpan(this.label9, 9);
     this.label9.Dock = System.Windows.Forms.DockStyle.Fill;
     this.label9.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
     this.label9.Font = new System.Drawing.Font("Arial Narrow", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.label9.ForeColor = System.Drawing.Color.Black;
     this.label9.Location = new System.Drawing.Point(551, 15);
     this.label9.Name = "label9";
     this.label9.Size = new System.Drawing.Size(235, 23);
     this.label9.TabIndex = 31;
     this.label9.Text = "MOVIE TITLE";
     this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
     //
     // splitter1
     //
     this.splitter1.Location = new System.Drawing.Point(0, 0);
     this.splitter1.Name = "splitter1";
     this.splitter1.Size = new System.Drawing.Size(3, 508);
     this.splitter1.TabIndex = 5;
     this.splitter1.TabStop = false;
     //
     // imageList1
     //
     this.imageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
     this.imageList1.ImageSize = new System.Drawing.Size(16, 16);
     this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
     //
     // folderBrowserDialog1
     //
     this.folderBrowserDialog1.RootFolder = System.Environment.SpecialFolder.MyComputer;
     this.folderBrowserDialog1.ShowNewFolderButton = false;
     //
     // radListBoxItem5
     //
     this.radListBoxItem5.Name = "radListBoxItem5";
     //
     // radThemeManager1
     //
     themeSource1.ThemeLocation = "movieliststylesheet.xml";
     themeSource2.ThemeLocation = "movieliststylesheet.xml";
     this.radThemeManager1.LoadedThemes.AddRange(new Telerik.WinControls.ThemeSource[] {
     themeSource1,
     themeSource2});
     //
     // Form1
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
     this.ClientSize = new System.Drawing.Size(792, 508);
     this.Controls.Add(this.panel1);
     this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
     this.KeyPreview = true;
     this.Menu = this.mainMenu1;
     this.Name = "Form1";
     this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
     this.Text = "Movie List  v.1";
     this.TransparencyKey = System.Drawing.Color.LightPink;
     this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
     this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyDown);
     this.panel1.ResumeLayout(false);
     this.tableLayoutPanel1.ResumeLayout(false);
     this.tableLayoutPanel1.PerformLayout();
     this.tableLayoutPanel2.ResumeLayout(false);
     this.tableLayoutPanel2.PerformLayout();
     ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.listBox1)).EndInit();
     this.ResumeLayout(false);
 }
        private HtmlGenericControl CreateHeaderDiv(Criterion criterion)
        {
            var containerDiv = new HtmlGenericControl("div");

            var headerDiv = new HtmlGenericControl("div");
            headerDiv.Attributes["class"] = "criteriaHeaderDiv";

            var headerDivLbl = new HtmlGenericControl("div");
            headerDivLbl.Attributes["class"] = "left";

            var headerDivExpand = new HtmlGenericControl("div");
            headerDivExpand.Attributes["class"] = "right";

            var adjustedID = StripString(criterion.Key);

            headerDivExpand.ID = "expand_" + adjustedID;
            headerDivExpand.Style.Add("overflow", "hidden");

            var requiredAsterik = "";

            // Add tooltip
            if (!criterion.Locked && (criterion.UIType != UIType.None))
            {
                var tooltip = new RadToolTip
                {
                    Height = 55,
                    Width = 205,
                    TargetControlID = headerDivExpand.ID,
                    Position = ToolTipPosition.MiddleRight,
                    RelativeTo = ToolTipRelativeDisplay.Element,
                    HideEvent = ToolTipHideEvent.Default,
                    AutoCloseDelay = 20000,
                    Skin = "Black",
                    ShowEvent = ToolTipShowEvent.OnClick,
                    EnableShadow = true
                };

                var contentChunk = new HtmlGenericControl("div");
                contentChunk.Style.Add("position", "relative");

                if (criterion.IsRequired) //BJC - 6/11/2012: If this criterion object is required
                {
                    requiredFields.Value += criterion.Key + ","; //Add Key to the requiredFields hidden input value.
                    requiredAsterik = "<span style=\"font-weight:bold;color:#F00;\">*</span>";
                }

                // Add appropriate control to tooltip
                switch (criterion.UIType)
                {
                    case UIType.DropDownList:
                        var cmb = CreateDropDownList(criterion, adjustedID);

                        if (criterion.Object != null && criterion.ReportStringVal != null)
                        {
                            var selectedItemIndex = cmb.FindItemIndexByValue(adjustedID + "_" + criterion.ReportStringVal, true);
                            if (selectedItemIndex > 0) cmb.SelectedIndex = selectedItemIndex;
                            if (requiredFieldsSelected.Value.IndexOf(criterion.Key) == -1)
                            {
                                requiredFieldsSelected.Value += criterion.Key + ",";
                            }
                        }

                        contentChunk.Controls.Add(new HtmlGenericControl("div") { InnerText = criterion.Header });
                        contentChunk.Controls.Add(cmb);

                        tooltip.Attributes["dropDownListID"] = cmb.ID;
                        tooltip.OnClientShow = "onClientShowToolTipDropDownList";

                        break;

                    //case UIType.RadioButton:
                    //    {
                    //        var radioButtons = new RadButton()
                    //        {
                    //            ID = "RadRadioButtonCriteriaRadioButtonList",
                    //            GroupName = criterion.Key,
                    //            ToggleType = ButtonToggleType.Radio,
                    //            //AutoPostBack = false,
                    //            //OnClientToggleStateChanged = "OnClientToggleStateChanged"

                    //        };

                    //        if (criterion.DataSource == null)
                    //        {
                    //            radioButtons.ToggleStates.Add(new RadButtonToggleState("No data supplied", string.Format(adjustedID + "_" + "0")));
                    //        }
                    //        else
                    //        {
                    //            radioButtons.ToggleStates.Add(new RadButtonToggleState("All", string.Format(adjustedID + "_" + "0")));


                    //            foreach (DataRow row in ((DataTable)criterion.DataSource).Rows)
                    //            {
                    //                var rbItem = new RadButtonToggleState(row[criterion.DataTextField].ToString(),
                    //                                                      adjustedID + "_" +
                    //                                                      row[criterion.DataValueField]);

                    //                radioButtons.ToggleStates.Add(rbItem);
                    //            }
                    //        }

                    //        contentChunk.Controls.Add(new System.Web.UI.HtmlControls.HtmlGenericControl("div") { InnerText = criterion.Header });
                    //        contentChunk.Controls.Add(radioButtons);


                    //        break;
                    //    }

                    case UIType.CheckBoxList:
                        {
                            tooltip.Width = (criterion.ChildDataSource != null) ? 450 : 205;

                            var listBox = this.CreateCheckBoxList(criterion, adjustedID);
                            tooltip.Attributes.Add("lstBoxID", listBox.ClientID);

                            tooltip.OnClientShow = "setListBoxMaxHeight";

                            if (criterion.Object != null && criterion.ReportStringVal != null)
                            {
                                if (requiredFieldsSelected.Value.IndexOf(criterion.Key) == -1)
                                {
                                    requiredFieldsSelected.Value += criterion.Key + ",";
                                }
                            }

                            contentChunk.Controls.Add(new HtmlGenericControl("div") { InnerText = criterion.Header });
                            contentChunk.Controls.Add(listBox);

                            if (!string.IsNullOrEmpty(criterion.ChildHeader))
                            {
                                tooltip.OnClientShow = "TooltipOnClientShow_DisplayChildCheckboxItems";
                                tooltip.Attributes["ParentListID"] = "RadCombobBoxCriteriaCheckBoxList";
                                tooltip.Attributes["ChildListID"] = "RadCombobBoxCriteriaCheckBoxList2";

                                listBox.Attributes.Add("ChildCheckBoxList", "RadCombobBoxCriteriaCheckBoxList2");

                                var listBox2 = new RadListBox
                                {
                                    ID = "RadCombobBoxCriteriaCheckBoxList2",
                                    AutoPostBack = false,
                                    CheckBoxes = true,
                                    Skin = "Vista",
                                    OnClientItemChecked = "onItemChecked"
                                };

                                foreach (DataRow row in ((DataTable)criterion.ChildDataSource).Rows)
                                {
                                    var listBoxValue = string.Format("{0}_{1}", adjustedID, StripString(row[criterion.ChildDataValueField].ToString()));
                                    var listBoxItem = new RadListBoxItem(row[criterion.ChildDataTextField].ToString(), listBoxValue);
                                    listBoxItem.Attributes["parentValue"] = string.Format("{0}_{1}", adjustedID, StripString(row[criterion.ChildDataParentField].ToString()));
                                    listBoxItem.Attributes["checkBoxID"] = string.Format("{0}_RadCombobBoxCriteriaCheckBoxList2_CheckBox", listBoxValue);

                                    Criterion tempCriterion = null;
                                    foreach (Criterion c in Criteria.CriterionList)
                                    {
                                        if (c.Key == listBoxValue)
                                        {
                                            tempCriterion = c;
                                            break;
                                        }
                                    }

                                    if (tempCriterion != null)
                                    {
                                        listBoxItem.Checked = !tempCriterion.Empty;
                                    }

                                    listBox2.Items.Add(listBoxItem);
                                }

                                contentChunk.Controls.Add(new HtmlGenericControl("span") { InnerText = criterion.ChildHeader });
                                contentChunk.Controls.Add(listBox2);
                            }

                            break;
                        }

                    case UIType.TextBox:
                        {
                            var textBox = CreateTextBox(criterion, adjustedID);

                            if (criterion.Object != null && criterion.ReportStringVal != null)
                            {
                                if (requiredFieldsSelected.Value.IndexOf(criterion.Key) == -1)
                                {
                                    requiredFieldsSelected.Value += criterion.Key + ",";
                                }
                            }

                            contentChunk.Controls.Add(new HtmlGenericControl("div") { InnerText = criterion.Header });
                            contentChunk.Controls.Add(textBox);

                            tooltip.OnClientShow = "onClientShowToolTipTextBox";
                            tooltip.Attributes["textBoxID"] = textBox.ID;

                            break;
                        }

                    case UIType.DatePicker:
                        {
                            tooltip.Width = 330;

                            var startCriterion = Criteria.CriterionList.Find(c => c.Header == criterion.Header && c.IsHeader == false && c.Key.Contains("Start"));
                            var endCriterion = Criteria.CriterionList.Find(c => c.Header == criterion.Header && c.IsHeader == false && c.Key.Contains("End"));

                            var wrapperDiv = CreateDatePicker(adjustedID, startCriterion, endCriterion);

                            if (criterion.Object != null && criterion.ReportStringVal != null)
                            {
                                if (requiredFieldsSelected.Value.IndexOf(criterion.Key) == -1)
                                {
                                    requiredFieldsSelected.Value += criterion.Key + ",";
                                }
                            }

                            contentChunk.Controls.Add(new HtmlGenericControl("div") { InnerText = criterion.Header });
                            contentChunk.Controls.Add(wrapperDiv);

                            break;
                        }

                    case UIType.AssessmentTextSearch:
                        {
                            tooltip.Width = 400;

                            var wrapperDiv = new System.Web.UI.HtmlControls.HtmlGenericControl("div");
                            wrapperDiv.Style.Add("width", "350px");

                            var textBox = new RadTextBox
                            {
                                ID = "RadTextBoxAssessmentTextSearch",
                                AutoPostBack = false,
                                Skin = "Vista"
                            };

                            textBox.ClientEvents.OnBlur = "onInputBlur";
                            textBox.Attributes["updateMessageHeader"] = adjustedID;
                            textBox.Attributes["comboBoxDivID"] = "cmbBoxDiv";

                            //ADD DIV TO contentChunk
                            var textBoxDiv = new System.Web.UI.HtmlControls.HtmlGenericControl("div") { ID = "textBoxDiv" };
                            textBoxDiv.Controls.Add(textBox);


                            var textSearchCmb = new Telerik.Web.UI.RadComboBox
                            {
                                ID = "RadComboBoxAssessmentTextSearch",
                                AutoPostBack = false,
                                MarkFirstMatch = true,
                                AllowCustomText = false,
                                ZIndex = 8005,
                                OnClientSelectedIndexChanged = "onSelectedIndexChanged",
                                Skin = "Vista"
                            };
                            textSearchCmb.Attributes["textBoxDivID"] = "textBoxDiv";


                            if (criterion.Object != null)
                            {
                                var textSearchObjectArray = criterion.Object.ToString().Split(':');
                                textBox.Text = textSearchObjectArray[1].Trim();

                                var selectedItemIndex = textSearchCmb.FindItemIndexByText(textSearchObjectArray[0].Trim(), true);

                                textSearchCmb.SelectedIndex = selectedItemIndex;

                                if (requiredFieldsSelected.Value.IndexOf(criterion.Key) == -1)
                                {
                                    requiredFieldsSelected.Value += criterion.Key + ",";
                                }
                            }

                            var textSearchCmbDiv = new System.Web.UI.HtmlControls.HtmlGenericControl("div") { ID = "cmbBoxDiv" };
                            textSearchCmbDiv.Controls.Add(textSearchCmb);

                            if (criterion.DataSource == null)
                            {
                                textSearchCmb.Items.Add(new RadComboBoxItem("No data supplied", adjustedID + "_" + "0"));
                            }
                            else
                            {
                                foreach (DataRow row in ((DataTable)criterion.DataSource).Rows)
                                {
                                    textSearchCmb.Items.Add(new RadComboBoxItem(row[criterion.DataTextField].ToString(), adjustedID + "_" + row[criterion.DataValueField]));
                                }
                            }

                            contentChunk.Controls.Add(new System.Web.UI.HtmlControls.HtmlGenericControl("div") { InnerText = criterion.Header });

                            var wrapperDivLeft = new System.Web.UI.HtmlControls.HtmlGenericControl("div");
                            wrapperDivLeft.Style.Add("float", "left");
                            wrapperDivLeft.Style.Add("width", "149px");
                            wrapperDivLeft.Controls.Add(textBoxDiv);

                            var wrapperDivRight = new System.Web.UI.HtmlControls.HtmlGenericControl("div");
                            wrapperDivRight.Style.Add("float", "right");
                            wrapperDivRight.Style.Add("width", "149px");
                            wrapperDivRight.Controls.Add(textSearchCmbDiv);

                            wrapperDiv.Controls.Add(wrapperDivLeft);
                            wrapperDiv.Controls.Add(wrapperDivRight);

                            contentChunk.Controls.Add(wrapperDiv);

                            break;
                        }

                    case UIType.Demographics:
                        {
                            tooltip.Width = 390;

                            contentChunk.Controls.Add(new HtmlGenericControl("div") { InnerText = criterion.Header });
                            contentChunk.Controls.Add(CreateDemographics(criterion, adjustedID));

                            break;
                        }

                    case UIType.RTI:
                        {
                            contentChunk.Controls.Add(new HtmlGenericControl("div") { InnerText = criterion.Header });
                            contentChunk.Controls.Add(CreateRTI(criterion, adjustedID));

                            break;
                        }
                }

                tooltip.Controls.Add(contentChunk);
                headerDiv.Controls.Add(tooltip);
            }

            if (criterion.Locked == false)
            {
                headerDivExpand.Controls.Add(new Image { ImageUrl = "~/Images/commands/expand_bubble.png", Width = 16, Height = 16 });
            }
            else if (FirstTimeLoaded)
            {
                criterion.ReportStringVal = criterion.DefaultValue;
            }

            headerDivLbl.InnerHtml = criterion.Header + ":" + requiredAsterik;

            headerDiv.Controls.Add(headerDivLbl);
            headerDiv.Controls.Add(headerDivExpand);

            var updateMessageDiv = new System.Web.UI.HtmlControls.HtmlGenericControl("div");
            updateMessageDiv.Attributes["class"] = "criteriaUpdateMessageDiv";
            updateMessageDiv.Attributes["id"] = adjustedID + "_updateMessage";

            containerDiv.Controls.Add(headerDiv);
            containerDiv.Controls.Add(updateMessageDiv);

            return containerDiv;
        }
Example #34
0
        /// <summary>
        /// Loads product type list boxes from sharepoint list.
        /// </summary>
        /// <param name="listBox">The list box.</param>
        /// <param name="listName">Name of the list.</param>
        /// <param name="columnName">Name of the column.</param>
        private void PopulateProdTypeLstBox(RadListBox listBox, string listName, string columnName)
        {
            DataTable dtListItems = null;
            objMossController = objFactory.GetServiceManager("MossService");
            string strCamlQuery = "<OrderBy><FieldRef Name=\"" + columnName + "\"/></OrderBy>";
            string strViewFields = @"<FieldRef Name='" + columnName + "'/>";
            try
            {
                dtListItems = ((MOSSServiceManager)objMossController).ReadList(strCurrSiteUrl, listName, strCamlQuery, strViewFields);
                if((dtListItems != null) && (dtListItems.Rows.Count > 0))
                {
                    listBox.DataTextField = columnName;
                    listBox.DataValueField = columnName;//dtListItems.Columns[columnName].ColumnName;
                    listBox.DataSource = dtListItems;
                    listBox.DataBind();
                }
            }
            finally
            {
                if(dtListItems != null)
                {
                    dtListItems.Dispose();
                }

            }
        }
 private void GetTemplateChildren()
 {
     this.GroupListBox = this.GetTemplateChild(GroupListBoxPart) as RadListBox;
     this.ColumnsListBox = this.GetTemplateChild(ColumnsListBoxPart) as RadListBox;
 }
        private List<object> GetListBoxOrder(RadListBox listBox)
        {
            List<object> lstItems = new List<object>();

            switch (currMode)
            {
                case TabTypes.RoleHierarchy:
                    for (int i = 0; i < listBox.Items.Count; i++)
                    {
                        lstItems.Add(AllRoles.First(x => x.RoleName == listBox.Items[i].Text).RoleId);
                    }
                    break;
            }

            return lstItems;
        }
Example #37
0
 /// <summary>
 /// Loads the category.
 /// </summary>
 /// <param name="radListBx">The RAD list bx.</param>
 /// <param name="assetType">Type of the asset.</param>
 private void LoadCategory(RadListBox radListBx, string assetType)
 {
     Reorder objReorder = new Reorder();
     XmlNodeList xmlNdLstSourceCol = null;
     xmlNdLstSourceCol = objReorder.GetNdLstForCategory(ddlRole.SelectedValue, assetType);
     radListBx.Items.Clear();
     if(xmlNdLstSourceCol != null && xmlNdLstSourceCol.Count > 0)
     {
         radListBx.DataSource = xmlNdLstSourceCol;
         radListBx.DataTextField = "value";
         radListBx.DataValueField = "value";
         radListBx.DataBind();
     }
 }
Example #38
0
        /// <summary>
        /// Loads the list box.
        /// </summary>
        /// <param name="objRadLstBxSource">The obj RAD LST bx source.</param>
        /// <param name="objRadLstBxDestination">The obj RAD LST bx destination.</param>
        private void LoadListOfContextSearch(RadListBox objRadLstBxSource, RadListBox objRadLstBxDestination)
        {
            Reorder objReorder = new Reorder();
            XmlNodeList xmlNdLstSourceCol = null;
            XmlNodeList xmlNdLstDestinationCol = null;
            objReorder.SetSrcNDestNdLstForContextSearch(ddlRole.SelectedValue, radLstBxCategory.SelectedValue, ddlAssetType.SelectedValue, out xmlNdLstSourceCol, out xmlNdLstDestinationCol);

            objRadLstBxSource.Items.Clear();
            if(xmlNdLstSourceCol != null && xmlNdLstSourceCol.Count > 0)
            {
                objRadLstBxSource.DataSource = xmlNdLstSourceCol;
                objRadLstBxSource.DataTextField = "value";
                objRadLstBxSource.DataValueField = "value";
                objRadLstBxSource.DataBind();
            }

            objRadLstBxDestination.Items.Clear();
            if(xmlNdLstDestinationCol != null && xmlNdLstDestinationCol.Count > 0)
            {
                objRadLstBxDestination.DataSource = xmlNdLstDestinationCol;
                objRadLstBxDestination.DataTextField = "value";
                objRadLstBxDestination.DataValueField = "value";
                objRadLstBxDestination.DataBind();
            }
        }
Example #39
0
        /// <summary>
        /// Loads the chapter RAD list box.
        /// </summary>
        /// <param name="bookID">The book ID.</param>
        /// <param name="radListBox">The RAD list box.</param>
        protected void LoadChapterRadListBox(string bookID, RadListBox radListBox)
        {
            if (!string.IsNullOrEmpty(bookID) && radListBox != null)
            {
                if (HttpContext.Current.Session[CHAPTERPREFERENCEXML] != null)
                {
                    /// Load the XML to XmlDocument or XmlNodeList
                    /// Load the chapterpreference session value to string object
                    /// then load the string to XmlDocument object and populate the RadListBox
                    string strChapterXml = (string)HttpContext.Current.Session[CHAPTERPREFERENCEXML];
                    XmlDocument xmlChapterPreference = new XmlDocument();
                    xmlChapterPreference.LoadXml(strChapterXml);
                    XmlNodeList xmlChapterNodes = xmlChapterPreference.SelectNodes("/BookInfo/Chapter");
                    RadListBoxItem objListItem = new RadListBoxItem();
                    foreach (XmlNode xmlNodeChapter in xmlChapterNodes)
                    {
                        objListItem = new RadListBoxItem();
                        objListItem.Text = xmlNodeChapter.Attributes["ChapterTitle"].Value;
                        objListItem.Value = xmlNodeChapter.Attributes["ChapterID"].Value;

                        if (xmlNodeChapter.Attributes["Display"].Value.ToLowerInvariant().Equals(TRUE))
                        {
                            objListItem.Checked = true;
                        }
                        radListBox.Items.Add(objListItem);
                    }
                }
            }
        }
 internal void HookEvents(RadListBox listBox)
 {
     listBox.AddHandler(ListControl.MouseDoubleClickEvent,
         new EventHandler<MouseButtonEventArgs>(OnListBoxDoubleClick), true);
 }
Example #41
0
 /// <summary>
 /// Gets the column order.
 /// </summary>
 /// <param name="radLstBxSource">The RAD LST bx source.</param>
 /// <param name="radLstBxDestination">The RAD LST bx destination.</param>
 /// <param name="nodeName">Name of the node.</param>
 /// <returns></returns>
 public string GetColumnOrder(RadListBox radLstBxSource, RadListBox radLstBxDestination, string nodeName)
 {
     string strColOrderStatus = string.Empty;
     strColOrderStatus = CreateColumnXMLString(radLstBxDestination, nodeName, "true");
     strColOrderStatus += CreateColumnXMLString(radLstBxSource, nodeName, "false");
     return strColOrderStatus;
 }
        private static TourneeListToGridBehavior GetAttachedBehavior(RadListBox listBox)
        {
            if (!instances.ContainsKey(listBox))
            {
                instances[listBox] = new TourneeListToGridBehavior();
                instances[listBox].AssociatedObject = listBox;
            }

            return instances[listBox];
        }
Example #43
0
 /// <summary>
 /// Creates the column XML string.
 /// </summary>
 /// <param name="radLstBx">The RAD LST bx.</param>
 /// <param name="nodeName">Name of the node.</param>
 /// <param name="strDiplayStatus">The STR diplay status.</param>
 /// <returns></returns>
 private static string CreateColumnXMLString(RadListBox radLstBx, string nodeName, string strDiplayStatus)
 {
     string strXml = string.Empty;
     for(int intCounter = 0; intCounter < radLstBx.Items.Count; intCounter++)
     {
         strXml += "<" + nodeName + " name=\"" + radLstBx.Items[intCounter].Value + "\" display=\"" + strDiplayStatus + "\"/>";
     }
     return strXml;
 }
Example #44
0
        /// <summary>
        /// Loads the list box.
        /// </summary>
        /// <param name="objRadLstBxSource">The obj RAD LST bx source.</param>
        /// <param name="objRadLstBxDestination">The obj RAD LST bx destination.</param>
        /// <param name="reponseXml">The reponse XML.</param>
        private void LoadListOfColumn(RadListBox objRadLstBxSource, RadListBox objRadLstBxDestination, XmlDocument reponseXml)
        {
            if(reponseXml != null)
            {
                Reorder objReorder = new Reorder();
                XmlNodeList xmlNdLstSourceCol = null;
                XmlNodeList xmlNdLstDestinationCol = null;
                RadListBoxItem radLstBxItem = null;
                objReorder.SetSourceNDestinationItemList(ddlRole.SelectedValue, ddlSearchNames.SelectedValue, ddlAssetType.SelectedValue, reponseXml, out xmlNdLstSourceCol, out xmlNdLstDestinationCol);

                objRadLstBxSource.Items.Clear();
                if(xmlNdLstSourceCol != null && xmlNdLstSourceCol.Count > 0)
                {
                    objRadLstBxSource.DataSource = xmlNdLstSourceCol;
                    objRadLstBxSource.DataTextField = "value";
                    objRadLstBxSource.DataValueField = "value";
                    objRadLstBxSource.DataBind();
                }

                objRadLstBxDestination.Items.Clear();
                if(xmlNdLstDestinationCol != null && xmlNdLstDestinationCol.Count > 0)
                {
                    foreach(XmlNode xmlNodeCol in xmlNdLstDestinationCol)
                    {
                        radLstBxItem = new RadListBoxItem(xmlNodeCol.Attributes["name"].Value);
                        objRadLstBxDestination.Items.Add(radLstBxItem);
                        if(xmlNodeCol.Attributes["mandatory"].Value.ToLowerInvariant().Equals("true"))
                        {
                            radLstBxItem.Enabled = false;
                        }
                    }
                }
            }
        }
Example #45
0
        /// <summary>
        /// Saves the customise chapter preference to session object.
        /// Add the ChapterOrder attribute to SESSION_TREEVIEWXML object.
        /// </summary>
        /// <param name="bookID">The book ID.</param>
        /// <param name="bookName">Name of the book.</param>
        /// <param name="radListBox">The RAD list box.</param>
        protected void SaveCustomiseChapterPreferenceToSession(string bookID, string bookName, RadListBox radListBox)
        {
            XmlDocument chapterListXml = new XmlDocument();
            CommonBLL objCommonBLL = new CommonBLL();

            DWBDataObjects.ChapterInfo objChapterInfo;
            DWBDataObjects.BookInfo objBookInfo = new DWBDataObjects.BookInfo();
            objBookInfo.BookName = bookName;
            objBookInfo.BookID = bookID;
            ArrayList arlChapters = new ArrayList();
            foreach (RadListBoxItem listItem in radListBox.Items)
            {
                objChapterInfo = new DWBDataObjects.ChapterInfo();
                objChapterInfo.ChapterTitle = listItem.Text;
                objChapterInfo.ChapterID = listItem.Value;
                if (listItem.Checked)
                {
                    objChapterInfo.Display = true;
                }
                arlChapters.Add(objChapterInfo);
            }

            objBookInfo.Chapters = arlChapters;

            chapterListXml = objCommonBLL.CreateWellBookDetailXML(objBookInfo);
            if (HttpContext.Current.Session[CHAPTERPREFERENCEXML] != null)
            {
                HttpContext.Current.Session.Remove(CHAPTERPREFERENCEXML);
            }
            /// Chapter preference XML created and stored to session.
            HttpContext.Current.Session[CHAPTERPREFERENCEXML] = chapterListXml.OuterXml;

            ///Adding ChapterOrder attribute to SESSION_TREEVIEWXML object.
            XmlDocument xmlDocWellBookDetails = new XmlDocument();
            xmlDocWellBookDetails.LoadXml((string)HttpContext.Current.Session[SESSION_TREEVIEWXML]);

            ReOrderChapterNode(xmlDocWellBookDetails, chapterListXml);
        }
        private RadListBox CreateCheckBoxList(Criterion criterion, string adjustedID)
        {
            var listBox = new RadListBox
            {
                ID = "RadCombobBoxCriteriaCheckBoxList" + adjustedID,
                AutoPostBack = false,
                CheckBoxes = true,
                Skin = "Vista",
                OnClientItemChecked = "onItemChecked",
                CssClass = "noWrapRadListBox"
            };

            if (criterion.Dependencies != null && criterion.Dependencies.Length > 0)
            {


                listBox.Attributes["dependencies"] = DependencyString(criterion);
            }

            if (!string.IsNullOrEmpty(criterion.ServiceUrl))
            {
                listBox.Attributes["serviceurl"] = criterion.ServiceUrl;
            }

            if (!string.IsNullOrEmpty(criterion.ServiceOnSuccess))
            {
                listBox.Attributes["successcallback"] = criterion.ServiceOnSuccess;
            }

            if (string.IsNullOrEmpty(listBox.Attributes["ListBoxIdentifier"]))
            {
                listBox.Attributes["ListBoxIdentifier"] = listBox.ClientID;
            }

            listBox.Style.Add(HtmlTextWriterStyle.Overflow, "auto !important");
            listBox.Style.Add(HtmlTextWriterStyle.Height, "100%");
            listBox.Style.Add(HtmlTextWriterStyle.Width, "100%");

            if (criterion.DataSource == null)
            {
                listBox.Items.Add(new RadListBoxItem("No data supplied", string.Format("{0}_0", adjustedID)));
                listBox.CheckBoxes = false;
            }
            else
            {
                foreach (DataRow row in ((DataTable)criterion.DataSource).Rows)
                {
                    var listBoxValue = string.Format(
                        "{0}_{1}", adjustedID, StripString(row[criterion.DataValueField].ToString()));
                    var listBoxItem = new RadListBoxItem(row[criterion.DataTextField].ToString(), listBoxValue);
                    listBoxItem.Attributes["checkBoxID"] =
                        string.Format("{0}_RadCombobBoxCriteriaCheckBoxList{1}_CheckBox", listBoxValue, adjustedID);

                    // This fails with an exception if no First item.
                    //var tempCriterion = Criteria.CriterionList.First(r => r.Key == listBoxValue);
                    // Do it so that no exceptions are generated.
                    Criterion tempCriterion = null;
                    foreach (Criterion c in this.Criteria.CriterionList)
                    {
                        if (c.Key == listBoxValue)
                        {
                            tempCriterion = c;
                            break;
                        }
                    }

                    if (tempCriterion != null)
                    {
                        if (FirstTimeLoaded)
                        {
                            if (!String.IsNullOrEmpty(tempCriterion.DefaultValue) &&
                                tempCriterion.DefaultValue.Contains(StripString(row[criterion.DataValueField].ToString())))
                            {
                                tempCriterion.Object = listBoxItem.Text;
                                tempCriterion.ReportStringVal = tempCriterion.DefaultValue;
                                listBoxItem.Checked = true;
                            }
                            else
                            {
                                listBoxItem.Checked = !tempCriterion.Empty;
                            }
                        }
                        else
                        {
                            if (adjustedID=="SchoolType")
                            {
                                listBoxItem.Checked = hiddenSchoolTypeListSelected.Text.Contains(listBoxItem.Value);
                            }
                            else
                            {
                                listBoxItem.Checked = hiddenGradeListSelected.Text.Contains(listBoxItem.Value);
                            }
                           
                        }
                    }

                    listBox.Items.Add(listBoxItem);
                }

                if (IsPostBack && !string.IsNullOrEmpty(criterion.ServiceUrl))
                {
                    var javascript = "function () { serviceControlsList['" + adjustedID + "'].loaded = true; serviceControlsList['" + adjustedID + "'].callback = function () { loadServiceData('" + adjustedID + "', 'CheckBoxList'); } }";
                    ScriptManager.RegisterStartupScript(Page, typeof(Page), "StartupService" + adjustedID, "addServiceControl('" + adjustedID + "');", true);
                    ScriptManager.RegisterStartupScript(Page, typeof(Page), "CheckServiceControls", "loadingInterval = window.setInterval('checkServiceControlsFullyLoaded()', 200);", true);

                    listBox.OnClientLoad = javascript;
                }
            }

            return listBox;
        }