예제 #1
14
        public void LoadMobileNo(UltraCombo cbo, int PersonID)
        {
            //            string Qry=@"Select A.PersonID,B.PersonPhone from Trans_LoanPosting A
            //inner join Trans_LoanAssign B ON A.PersonID=B.PersonID
            //where LoanPostingID='" + PersonID + "' and A.IsActive=1";
            //string Qry = @"Select PersonID,PersonPhone from Trans_LoanAssign A where PersonID='" + PersonID + "' ";
            string         Qry            = @"Select A.PersonID,B.PersonPhone from Trans_LoanPosting A
inner join Trans_LoanAssign B ON A.PersonID = B.PersonID
where A.PersonID= '" + PersonID + "' and A.IsActive=1";
            SqlConnection  connection     = new SqlConnection(this.ConnString);
            SqlCommand     selectCommand  = new SqlCommand(Qry, connection);
            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(selectCommand);
            DataTable      dataTable      = new DataTable();

            sqlDataAdapter.Fill(dataTable);
            cbo.DataSource    = dataTable;
            cbo.ValueMember   = "PersonID";
            cbo.DisplayMember = "PersonPhone";
            cbo.DisplayLayout.Bands[0].Columns["PersonID"].Hidden = true;
            cbo.DisplayLayout.AutoFitStyle = AutoFitStyle.ResizeAllColumns;
            //cbo.Value = 1;

            connection.Close();
            sqlDataAdapter.Dispose();
            selectCommand.Dispose();
        }
예제 #2
0
        public void LoadBuildingByOfficeID(UltraCombo cbo, int OfficeID)
        {
            //string str = BLLObj.LoadBuildingfromOfficesEdit(OfficeID);
            //dt = GlobalVaribles.DeserializeDataTable(str);
            //cbo.DataSource = dt;
            //cbo.ValueMember = "BuildingID";
            //cbo.DisplayMember = "BuildingName";
            //cbo.DisplayLayout.Bands[0].Columns["BuildingID"].Hidden = true;
            //cbo.DisplayLayout.AutoFitStyle = AutoFitStyle.ResizeAllColumns;
            //cbo.Value = OfficeID;
            // cbo.ReadOnly = true;


            string str = BLLObj.LoadAllBuildingforOffice();

            dt = GlobalVaribles.DeserializeDataTable(str);
            //sqlDataAdapter.Fill(dataTable);
            cbo.DataSource    = dt;
            cbo.ValueMember   = "BuildingID";
            cbo.DisplayMember = "BuildingName";
            cbo.DisplayLayout.Bands[0].Columns["BuildingID"].Hidden = true;
            cbo.DisplayLayout.AutoFitStyle = AutoFitStyle.ResizeAllColumns;

            string strr = BLLObj.LoadBuildingfromOfficesEdit(OfficeID);

            dt        = new DataTable();
            dt        = GlobalVaribles.DeserializeDataTable(strr);
            cbo.Value = Convert.ToInt32(dt.Rows[0]["BuildingID"].ToString());
            //cbo.Value = 0;
        }
예제 #3
0
        protected void ControlCombo_ItemNotInList(object sender, ValidationErrorEventArgs e)
        {
            try
            {
                UltraCombo control = (UltraCombo)sender;
                if (string.IsNullOrEmpty(control.Text.Trim()))
                {
                    return;
                }
                // Tiếp tục Focus vào control có giá trị nhập sai
                e.RetainFocus = true;
                // Thông báo lỗi dữ liệu nhập
                MessageBoxCommon.ShowExclamation(string.Format(Properties.Resources.Message_Error_Input_Dropdown, control.Tag));

                if (e.LastValidValue != null)
                {
                    control.Value = e.LastValidValue;
                }
                else
                {
                    control.Text = "";
                }
                control.SelectAll();
            }
            catch (Exception ex)
            {
#if Debug
                MessageBoxCommon.ShowException(ex);
#endif
            }
        }
예제 #4
0
        public static void UcitajComboLayout(UltraCombo combo)
        {
            if (combo.FindForm() != null)
            {
                if (File.Exists(System.Windows.Forms.Application.StartupPath + @"\" + combo.FindForm().Name + combo.Name.ToString() + ".lyt"))
                {
                    FileStream stream = new FileStream(System.Windows.Forms.Application.StartupPath + @"\" + combo.FindForm().Name + combo.Name.ToString() + ".lyt", FileMode.Open);
                    stream.Seek(0L, SeekOrigin.Begin);
                    combo.DisplayLayout.Load(stream);
                    stream.Close();

                    // Matija - ovaj return je dodan pošto je ostatak bio u IF petlji
                    return;
                }
            }

            if (combo.Rows.Count > 0)
            {
                ColumnEnumerator enumerator = combo.DisplayLayout.Bands[0].Columns.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    enumerator.Current.PerformAutoResize(PerformAutoSizeType.AllRowsInBand, true);
                }
            }
            combo.DisplayLayout.Bands[0].Columns[combo.ValueMemberResolved].SortIndicator = SortIndicator.Ascending;
        }
예제 #5
0
 public static void PostaviGresku(UltraCombo combo, string opisgreske)
 {
     if (combo.Tag != null)
     {
         ((ErrorProvider)combo.Tag).SetError(combo, opisgreske);
     }
 }
예제 #6
0
        public void LoadBuildingByFloorID(UltraCombo cbo, int floorID)
        {
            string str = BLLObj_Building.LoadAllBuildingCombo();

            dt = GlobalVaribles.DeserializeDataTable(str);
            //sqlDataAdapter.Fill(dataTable);
            cbo.DataSource    = dt;
            cbo.ValueMember   = "BuildingID";
            cbo.DisplayMember = "BuildingName";
            cbo.DisplayLayout.Bands[0].Columns["BuildingID"].Hidden = true;
            cbo.DisplayLayout.AutoFitStyle = AutoFitStyle.ResizeAllColumns;

            string strr = BLLObj.LoadBuildingIDByFloorID(floorID);

            dt = new DataTable();
            dt = GlobalVaribles.DeserializeDataTable(strr);

            cbo.Value = Convert.ToInt32(dt.Rows[0]["BuildingID"]);


            //cbo.DataSource = dt;
            //cbo.ValueMember = "BuildingID";
            //cbo.DisplayMember = "BuildingName";
            //cbo.DisplayLayout.Bands[0].Columns["BuildingID"].Hidden = true;
            //cbo.DisplayLayout.AutoFitStyle = AutoFitStyle.ResizeAllColumns;
            //cbo.Value = floorID;
            // cbo.ReadOnly = true;
        }
예제 #7
0
 private static void Combo_AfterColPosChanged(object sender, AfterColPosChangedEventArgs e)
 {
     if (e.PosChanged == PosChanged.Sized)
     {
         UltraCombo combo = (UltraCombo)sender;
         if (((UltraCombo)sender).FindForm() != null)
         {
             Label label = (Label)FindControl(((UltraCombo)sender).FindForm(), "lbldynamic" + ((UltraCombo)sender).FindForm().Name + ((UltraCombo)sender).Name);
             if (combo.DisplayMember == e.ColumnHeaders[0].Column.Key)
             {
                 if ((e.ColumnHeaders[0].Column.CellSizeResolved.Width + 0x23) > 420)
                 {
                     combo.Width = 420;
                 }
                 else
                 {
                     combo.Width = e.ColumnHeaders[0].Column.CellSizeResolved.Width + 0x23;
                 }
                 if (label != null)
                 {
                     label.Left = ((combo.Left + combo.Width) + Conversions.ToInteger(Interaction.IIf(((UltraCombo)sender).Tag != null, 0x10, 0))) + 5;
                 }
             }
         }
     }
 }
예제 #8
0
        public static void BindProduct(UltraCombo cmb)
        {
            DataTable dt = GetProduct("", "");

            cmb.DataSource    = dt;
            cmb.DisplayMember = "cnvcProductName";
            cmb.ValueMember   = "cnvcProductName";
        }
        public static void ReadOnly_Control(Control ctr)
        {
            try
            {
                foreach (Control txt in ctr.Controls)
                {
                    ReadOnly_Control(txt);
                    switch (txt.GetType().Name)
                    {
                    case "UltraTextEditor":
                    {
                        UltraTextEditor Ultratxt = txt as UltraTextEditor;
                        Ultratxt.ReadOnly = true;
                        break;
                    }

                    case "TextBox":
                    {
                        TextBox textboxtxt = txt as TextBox;
                        textboxtxt.ReadOnly = true;
                        break;
                    }

                    case "UltraCombo":
                    {
                        UltraCombo textboxtxt = txt as UltraCombo;
                        textboxtxt.ReadOnly = true;
                        break;
                    }

                    case "UltraComboEditor":
                    {
                        UltraComboEditor textboxtxt = txt as UltraComboEditor;
                        textboxtxt.ReadOnly = true;
                        break;
                    }

                    case "UltraDateTimeEditor":
                    {
                        UltraDateTimeEditor textboxtxt = txt as UltraDateTimeEditor;
                        textboxtxt.ReadOnly = true;
                        break;
                    }

                    case "UltraNumericEditor":
                    {
                        UltraNumericEditor textboxtxt = txt as UltraNumericEditor;
                        textboxtxt.ReadOnly = true;
                        break;
                    }
                    }
                }
            }
            catch (Exception)
            {
            }
        }
예제 #10
0
 //Hide combo box headers
 public static void HideComboColumns(UltraCombo combo)
 {
     foreach (
         UltraGridColumn col in
             combo.DisplayLayout.Bands[0].Columns.Cast<UltraGridColumn>()
                                         .Where(col => col.Header.Caption.Contains("__")))
     {
         col.Hidden = true;
     }
 }
예제 #11
0
 //Hide combo box headers
 public static void HideComboColumns(UltraCombo combo)
 {
     foreach (
         UltraGridColumn col in
         combo.DisplayLayout.Bands[0].Columns.Cast <UltraGridColumn>()
         .Where(col => col.Header.Caption.Contains("__")))
     {
         col.Hidden = true;
     }
 }
예제 #12
0
        public static void LoadUltraComboList(UltraCombo prmDropDownList, string prmDataTextField = null, string prmDataValueField = null, List <GridKeyValueDTO> prmDataSource = null, DropDownListAction?prmDropDownListAction = null)
        {
            GridKeyValueDTO firstItem      = null;
            var             priorFirstItem = prmDataSource.FirstOrDefault(p => p.Id == "-1");

            if (prmDropDownListAction != null)
            {
                switch (prmDropDownListAction)
                {
                case DropDownListAction.All:
                    if (prmDataTextField == "Value1")
                    {
                        firstItem = new GridKeyValueDTO()
                        {
                            Id = Constants.AllValue, Value1 = Constants.All
                        };
                    }
                    //else if (prmDataTextField == "Value2")
                    //{
                    //    firstItem = new GridKeyValueDTO() { Id = Constants.AllValue, Value2 = Constants.All };
                    //}
                    break;

                case DropDownListAction.Select:
                    if (prmDataTextField == "Value1")
                    {
                        firstItem = new GridKeyValueDTO()
                        {
                            Id = Constants.SelectValue, Value1 = Constants.Select
                        };
                    }
                    //else if (prmDataTextField == "Value2")
                    //{
                    //    firstItem = new GridKeyValueDTO() { Id = Constants.SelectValue, Value2 = Constants.Select };
                    //}

                    break;
                }
            }
            if (priorFirstItem == null && firstItem != null)
            {
                prmDataSource.Insert(0, firstItem);
            }

            if (prmDataSource != null)
            {
                if (prmDataSource.Count != 0)
                {
                    prmDropDownList.DataSource    = prmDataSource;
                    prmDropDownList.DisplayMember = prmDataTextField;
                    prmDropDownList.ValueMember   = prmDataValueField;
                }
            }
        }
예제 #13
0
        public void LoadAllBuilding(UltraCombo cbo)
        {
            string str = BLLObj_Building.LoadAllBuilding();

            dt = GlobalVaribles.DeserializeDataTable(str);
            //sqlDataAdapter.Fill(dataTable);
            cbo.DataSource    = dt;
            cbo.ValueMember   = "BuildingID";
            cbo.DisplayMember = "BuildingName";
            cbo.DisplayLayout.Bands[0].Columns["BuildingID"].Hidden = true;
            cbo.DisplayLayout.AutoFitStyle = AutoFitStyle.ResizeAllColumns;
            cbo.Value = 0;
        }
        public static void ReserAll(Control ctr)
        {
            try
            {
                foreach (Control txt in ctr.Controls)
                {
                    ReserAll(txt);
                    switch (txt.GetType().Name)
                    {
                    case "UltraTextEditor":
                    {
                        UltraTextEditor Ultratxt = txt as UltraTextEditor;
                        Ultratxt.Text = string.Empty;
                        break;
                    }

                    case "TextBox":
                    {
                        TextBox textboxtxt = txt as TextBox;
                        textboxtxt.Text = string.Empty;
                        break;
                    }

                    case "UltraCombo":
                    {
                        UltraCombo textboxtxt = txt as UltraCombo;
                        textboxtxt.Text = string.Empty;
                        break;
                    }

                    case "UltraComboEditor":
                    {
                        UltraComboEditor textboxtxt = txt as UltraComboEditor;
                        textboxtxt.Text = string.Empty;
                        break;
                    }

                    case "UltraNumericEditor":
                    {
                        UltraNumericEditor textboxtxt = txt as UltraNumericEditor;
                        textboxtxt.Value = 0;
                        break;
                    }
                    }
                }
            }
            catch (Exception)
            {
            }
        }
예제 #15
0
 public ProblemInputForm()
 {
     InitializeComponent();
     _problemController   = new ProblemInputController();
     _tagController       = new TagInputController();
     _problem             = new Problem();
     ultraCombo1          = new UltraCombo();
     ultraCombo1.Location = new Point(titleTxtbox.Location.X, 12);
     ultraCombo1.Size     = new Size(titleTxtbox.Size.Width, 21);
     Controls.Add(ultraCombo1);
     ultraCombo1.DataSource = _tagController.TagsToTable();
     fillUltraCombo();
     numericUpDown1.ReadOnly = false;
 }
예제 #16
0
 public static void Loadcbokhoa(this UltraCombo @ultraCombo)
 {
     @ultraCombo = new UltraCombo
     {
         ValueMember = "ID",
         DisplayMember = "TenKhoa"
     };
     @ultraCombo.DisplayLayout.ScrollStyle = ScrollStyle.Immediate;
     @ultraCombo.DisplayLayout.ScrollBounds = ScrollBounds.ScrollToFill;
     @ultraCombo.Rows.Band.Columns["ID"].Hidden = true;
     @ultraCombo.Rows.Band.Columns["MaKhoa"].Hidden = true;
     @ultraCombo.Rows.Band.Columns["TenKhoa"].Width = 400;
     @ultraCombo.DisplayLayout.Bands[0].Columns["TenKhoa"].Header.Caption = @"Khoa";
     @ultraCombo.DisplayLayout.Bands[0].Columns["TenKhoa"].SortIndicator = SortIndicator.Ascending;
     //@ultraCombo.DropDownWidth = 0;
     //@column.Style = ColumnStyle.DropDownList;
 }
예제 #17
0
 public static void Loadcbokhoa(this UltraCombo @ultraCombo)
 {
     @ultraCombo = new UltraCombo
     {
         ValueMember   = "ID",
         DisplayMember = "TenKhoa"
     };
     @ultraCombo.DisplayLayout.ScrollStyle          = ScrollStyle.Immediate;
     @ultraCombo.DisplayLayout.ScrollBounds         = ScrollBounds.ScrollToFill;
     @ultraCombo.Rows.Band.Columns["ID"].Hidden     = true;
     @ultraCombo.Rows.Band.Columns["MaKhoa"].Hidden = true;
     @ultraCombo.Rows.Band.Columns["TenKhoa"].Width = 400;
     @ultraCombo.DisplayLayout.Bands[0].Columns["TenKhoa"].Header.Caption = @"Khoa";
     @ultraCombo.DisplayLayout.Bands[0].Columns["TenKhoa"].SortIndicator  = SortIndicator.Ascending;
     //@ultraCombo.DropDownWidth = 0;
     //@column.Style = ColumnStyle.DropDownList;
 }
예제 #18
0
        public void LoadfloorByBuildingID(UltraCombo cbo, int BuildingID)
        {
            string str = BLLObj.LoadfloorByBuildingID(BuildingID);

            dt = GlobalVaribles.DeserializeDataTable(str);
            if (dt != null && dt.Rows.Count > 0)
            {
                cbo.DataSource    = dt;
                cbo.ValueMember   = "FloorID";
                cbo.DisplayMember = "FloorName";
                cbo.DisplayLayout.Bands[0].Columns["FloorID"].Hidden = true;
                cbo.DisplayLayout.AutoFitStyle = AutoFitStyle.ResizeAllColumns;
                cbo.Value = BuildingID;
            }

            // cbo.ReadOnly = true;
        }
예제 #19
0
        public void LoadAssignPersonName(UltraCombo cbo)
        {
            SqlConnection  connection     = new SqlConnection(this.ConnString);
            SqlCommand     selectCommand  = new SqlCommand("Select PersonID,PersonName From Trans_LoanAssign Where IsActive=1", connection);
            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(selectCommand);
            DataTable      dataTable      = new DataTable();

            sqlDataAdapter.Fill(dataTable);
            cbo.DataSource    = dataTable;
            cbo.ValueMember   = "PersonID";
            cbo.DisplayMember = "PersonName";
            cbo.DisplayLayout.Bands[0].Columns["PersonID"].Hidden = true;
            cbo.DisplayLayout.AutoFitStyle = AutoFitStyle.ResizeAllColumns;
            cbo.Value = 0;
            connection.Close();
            sqlDataAdapter.Dispose();
            selectCommand.Dispose();
        }
예제 #20
0
 public void LoadOfficesForBilling(UltraCombo cbo)
 {
     try
     {
         string str = BLLObj.LoadOfficesForBilling();
         dt = GlobalVaribles.DeserializeDataTable(str);
         //sqlDataAdapter.Fill(dataTable);
         cbo.DataSource    = dt;
         cbo.ValueMember   = "OfficeID";
         cbo.DisplayMember = "OfficeName";
         cbo.DisplayLayout.Bands[0].Columns["OfficeID"].Hidden = true;
         cbo.DisplayLayout.AutoFitStyle = AutoFitStyle.ResizeAllColumns;
         cbo.Value = 0;
     }
     catch (Exception)
     {
         //throw;
     }
 }
        private static UltraCombo CboQuyen()
        {
            var ucQuyen = new UltraCombo();
            var table   = new DataTable();

            table.Columns.Add("Quyen");
            table.Rows.Add("quantri");
            table.Rows.Add("nguoidung");

            ucQuyen.DataSource    = table;
            ucQuyen.DisplayMember = "Quyen";
            ucQuyen.ValueMember   = "Quyen";

            ucQuyen.DisplayLayout.ScrollStyle  = ScrollStyle.Immediate;
            ucQuyen.DisplayLayout.ScrollBounds = ScrollBounds.ScrollToFill;
            ucQuyen.DropDownWidth = 0;
            ucQuyen.Rows.Band.ColHeadersVisible      = false;
            ucQuyen.Rows.Band.Columns["Quyen"].Width = 250;
            return(ucQuyen);
        }
예제 #22
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="column">cột của grid</param>
        public static void Loadcbokhoa(this UltraGridColumn @column)
        {
            var ultraCombo = new UltraCombo
            {
                DataSource    = LoadData.Load(15),
                ValueMember   = "ID",
                DisplayMember = "TenKhoa"
            };

            ultraCombo.DisplayLayout.ScrollStyle          = ScrollStyle.Immediate;
            ultraCombo.DisplayLayout.ScrollBounds         = ScrollBounds.ScrollToFill;
            ultraCombo.Rows.Band.Columns["STT"].Hidden    = true;
            ultraCombo.Rows.Band.Columns["ID"].Hidden     = true;
            ultraCombo.Rows.Band.Columns["TenKhoa"].Width = 250;
            ultraCombo.DisplayLayout.Bands[0].Columns["TenKhoa"].Header.Caption = @"Khoa";
            ultraCombo.DisplayLayout.Bands[0].Columns["TenKhoa"].SortIndicator  = SortIndicator.Ascending;
            ultraCombo.DropDownWidth = 0;
            @column.EditorComponent  = ultraCombo;
            //@column.Style = ColumnStyle.DropDownList;
        }
예제 #23
0
    public Form1()
    {
        InitializeComponent();
        DataTable dt = new DataTable();

        dt.Columns.Add("Int", typeof(int));
        dt.Rows.Add(1);
        dt.Rows.Add(1);
        dt.Rows.Add(1);
        DataTable dtt = new DataTable();

        dtt.Columns.Add("Int", typeof(int));
        dtt.Rows.Add(2);
        dtt.Rows.Add(2);
        dtt.Rows.Add(2);
        uc = new UltraCombo();
        uc.BindingContext = this.BindingContext;
        uc.DataSource     = dtt;

        ultraGrid1.DataSource = dt.DefaultView;
    }
예제 #24
0
 private void cboArea_ItemNotInList(object sender, Infragistics.Win.UltraWinEditors.ValidationErrorEventArgs e)
 {
     try
     {
         e.RetainFocus = true;
         if (sender.GetType() == typeof(Infragistics.Win.UltraWinGrid.UltraCombo))
         {
             UltraCombo control = (UltraCombo)sender;
             MessageBoxCommon.ShowMessageError(string.Format("Dữ liệu <{0}> không có trong danh mục", control.Tag));
             control.SelectAll();
             if (!control.IsDroppedDown)
             {
                 control.ToggleDropdown();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBoxCommon.ShowException(ex);
     }
 }
예제 #25
0
        public void LoadfloorByOfficeIDinEdit(UltraCombo cbo, int OfficeID)
        {
            BuildingID = Convert.ToInt32(cboBuildingName.Value);
            string str = BLLObj.LoadfloorByBuildingID(BuildingID);

            dt = GlobalVaribles.DeserializeDataTable(str);
            if (dt != null && dt.Rows.Count > 0)
            {
                cbo.DataSource    = dt;
                cbo.ValueMember   = "FloorID";
                cbo.DisplayMember = "FloorName";
                cbo.DisplayLayout.Bands[0].Columns["FloorID"].Hidden = true;
                cbo.DisplayLayout.AutoFitStyle = AutoFitStyle.ResizeAllColumns;
                //cbo.Value = BuildingID;
            }

            string strr = BLLObj.LoadfloorByOfficeIDinEdit(OfficeID);

            dt        = GlobalVaribles.DeserializeDataTable(strr);
            cbo.Value = Convert.ToInt32(dt.Rows[0]["FloorID"].ToString());
            // cbo.ReadOnly = true;
        }
예제 #26
0
        public static void LoadcboLop(this UltraGridColumn @column)
        {
            var ultraCombo = new UltraCombo
            {
                ValueMember   = "ID",
                DisplayMember = "MaLop"
            };

            ultraCombo.DisplayLayout.ScrollStyle          = ScrollStyle.Immediate;
            ultraCombo.DisplayLayout.ScrollBounds         = ScrollBounds.ScrollToFill;
            ultraCombo.Rows.Band.Columns["ID"].Hidden     = true;
            ultraCombo.Rows.Band.Columns["IdKhoa"].Hidden = true;
            ultraCombo.Rows.Band.Columns["GhiChu"].Hidden = true;
            ultraCombo.Rows.Band.Columns["Khoa"].Hidden   = true;
            ultraCombo.Rows.Band.Columns["MaLop"].Width   = 200;
            ultraCombo.DropDownWidth = 0;
            ultraCombo.DisplayLayout.Bands[0].Columns["MaLop"].Header.Caption = @"Lớp";
            ultraCombo.DisplayLayout.Bands[0].Columns["MaLop"].SortIndicator  = SortIndicator.Ascending;
            @column.EditorComponent = ultraCombo;
            //var a = (UltraCombo)@column.EditorComponent;
            //a.DisplayLayout.Bands[0].ColumnFilters["ID"].FilterConditions.Add(FilterComparisionOperator.Equals, 2);
            //a.DisplayLayout.Bands[0].ColumnFilters.ClearAllFilters();
        }
예제 #27
0
        public void LoadofficeDetailsByID(UltraCombo cbo, int OfficeID)
        {
            string str = BLLObj.LoadofficeDetailsByID(OfficeID);

            dt = GlobalVaribles.DeserializeDataTable(str);
            if (dt != null && dt.Rows.Count > 0)
            {
                txttenantName.Text         = dt.Rows[0]["TenantName"].ToString();
                txtRent.Text               = dt.Rows[0]["OfficeRent"].ToString();
                txtElectricityPerUnit.Text = dt.Rows[0]["ElectricityPerUnit"].ToString();
                txtGeneratorPerUnit.Text   = dt.Rows[0]["GeneratorPerUnit"].ToString();
                txtMaintence.Text          = dt.Rows[0]["Maintenance"].ToString();
                txtwater.Text              = dt.Rows[0]["Water"].ToString();

                //txtOfficeID.Text = dt.Rows[0]["OfficeID"].ToString();

                //cbo.DataSource = dt;
                //cbo.ValueMember = "FloorID";
                //cbo.DisplayMember = "FloorName";
                //cbo.DisplayLayout.Bands[0].Columns["FloorID"].Hidden = true;
                //cbo.DisplayLayout.AutoFitStyle = AutoFitStyle.ResizeAllColumns;
                //cbo.Value = OfficeID;
            }
        }
예제 #28
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="column">cột của grid</param>
 public static void Loadcbokhoa(this UltraGridColumn @column)
 {
     var ultraCombo = new UltraCombo
     {
         DataSource = LoadData.Load(15),
         ValueMember = "ID",
         DisplayMember = "TenKhoa"
     };
     ultraCombo.DisplayLayout.ScrollStyle = ScrollStyle.Immediate;
     ultraCombo.DisplayLayout.ScrollBounds = ScrollBounds.ScrollToFill;
     ultraCombo.Rows.Band.Columns["STT"].Hidden = true;
     ultraCombo.Rows.Band.Columns["ID"].Hidden = true;
     ultraCombo.Rows.Band.Columns["TenKhoa"].Width = 250;
     ultraCombo.DisplayLayout.Bands[0].Columns["TenKhoa"].Header.Caption = @"Khoa";
     ultraCombo.DisplayLayout.Bands[0].Columns["TenKhoa"].SortIndicator = SortIndicator.Ascending;
     ultraCombo.DropDownWidth = 0;
     @column.EditorComponent = ultraCombo;
     //@column.Style = ColumnStyle.DropDownList;
 }
예제 #29
0
        public Size GenerateTipsForm(Sys_PD_Module module, List<Sys_PD_Filed> filedList, Control ctr, Point p)
        {
            Sys_PD_RefModule refModule = new Sys_PD_RefModule();
            ctr.Tag = module;
            ctr.Text = module.SPM_Name;

            int iTabInex = 0;
            int xPosition = p.X;
            int yPosition = p.Y;
            int vXPosition = p.X;
            int step = 0;//控制一行已经输出多少列
            int fTI = module.SPM_TI;
            int fTX = module.SPM_TX;
            int fTY = module.SPM_TY;
            int fHeight = module.SPM_Height;
            int controlWidth = 0;
            int controlHeight = 0;

            Size lableSize = new Size(module.SPM_LX, module.SPM_LY);//标签的大小
            Size textSize = new Size(fTX, fTY);//文本框的大小
            Size areaSize = new Size((fTX * 2) + module.SPM_LX + module.SPM_LI, fTY * 3);//备注框大小
            foreach (Sys_PD_Filed field in filedList)
            {

                if (field.DCP_IsHidden == 1)
                {
                    UltraTextEditor _hiddenBox = new UltraTextEditor();
                    _hiddenBox.Location = new System.Drawing.Point(vXPosition, yPosition);
                    _hiddenBox.Name = module.SPM_TPrefix + field.DCP_ControlID;
                    _hiddenBox.Visible = false;
                    ctr.Controls.Add(_hiddenBox);
                    continue;
                }
                if (field.DCP_Style == "newline" ||
                    (field.DCP_ControlType == "textarea" &&
                    step > module.SPM_CNum - 2))
                {
                    step = 0;
                    vXPosition = xPosition;
                    yPosition += fHeight;
                }

                fTI = module.SPM_TI;
                fTX = module.SPM_TX;
                fTY = module.SPM_TY;
                fHeight = module.SPM_Height;
                textSize = new Size(fTX, fTY);//文本框的大小
                areaSize = new Size((fTX * 2) + module.SPM_LX + module.SPM_LI, fTY * 3);

                /////////如果字段有自定义的大小,则赋值到相关模块
                if (field.DCP_TI != 0 && field.DCP_TX != 0 && field.DCP_TY != 0 && field.DCP_Height != 0)
                {
                    textSize = new Size(field.DCP_TX, field.DCP_TY);
                    areaSize = new Size(field.DCP_TX, field.DCP_TY);
                    fTX = field.DCP_TX;
                    fTY = field.DCP_TY;
                    fTI = field.DCP_TI;
                    fHeight = field.DCP_Height;
                }

                Infragistics.Win.Misc.UltraLabel _lab = new Infragistics.Win.Misc.UltraLabel();
                _lab.Location = new Point(vXPosition, yPosition + 6);
                _lab.Name = module.SPM_LPrefix + field.DCP_ControlID.ToString();
                _lab.Size = lableSize;
                _lab.TabIndex = iTabInex++;
                _lab.Text = field.DCP_Label.ToString();
                ctr.Controls.Add(_lab);

                vXPosition += module.SPM_LI;

                #region 控件生成
                switch (field.DCP_ControlType)
                {
                    case "dec":
                        UltraNumericEditor _numBox = new UltraNumericEditor();
                        _numBox.Location = new System.Drawing.Point(vXPosition, yPosition);
                        _numBox.Name = module.SPM_TPrefix + field.DCP_ControlID;
                        _numBox.Size = textSize;
                        _numBox.NumericType = NumericType.Double;
                        _numBox.TabIndex = iTabInex++;
                        _numBox.PromptChar = ' ';
                        _numBox.Nullable = true;
                        _numBox.NullText = "0";
                        if (field.DCP_IsReadonly == 1)
                        {
                            _numBox.ReadOnly = true;
                        }
                        ctr.Controls.Add(_numBox);
                        break;
                    case "int":
                        UltraNumericEditor _intBox = new UltraNumericEditor();
                        _intBox.Location = new System.Drawing.Point(vXPosition, yPosition);
                        _intBox.Name = module.SPM_TPrefix + field.DCP_ControlID;
                        _intBox.Size = textSize;
                        _intBox.NumericType = NumericType.Integer;
                        _intBox.TabIndex = iTabInex++;
                        if (field.DCP_IsReadonly == 1)
                        {
                            _intBox.ReadOnly = true;
                        }
                        _intBox.PromptChar = ' ';
                        _intBox.Nullable = true;
                        _intBox.NullText = "";
                        ctr.Controls.Add(_intBox);
                        break;
                    case "text":
                        UltraTextEditor _textBox = new UltraTextEditor();
                        _textBox.Location = new System.Drawing.Point(vXPosition, yPosition);
                        _textBox.Name = module.SPM_TPrefix + field.DCP_ControlID;
                        _textBox.Size = textSize;
                        _textBox.TabIndex = iTabInex++;
                        _textBox.Nullable = true;
                        if (field.DCP_IsReadonly == 1)
                        {
                            _textBox.ReadOnly = true;
                        }
                        ctr.Controls.Add(_textBox);
                        break;
                    case "textl":
                        UltraTextEditor _texBox = new UltraTextEditor();
                        _texBox.Location = new System.Drawing.Point(vXPosition, yPosition);
                        _texBox.Name = module.SPM_TPrefix + field.DCP_ControlID;
                        _texBox.Size = new Size(textSize.Width * 2, textSize.Height);
                        _texBox.TabIndex = iTabInex++;
                        if (field.DCP_IsReadonly == 1)
                        {
                            _texBox.ReadOnly = true;
                        }
                        ctr.Controls.Add(_texBox);
                        step++;
                        vXPosition += (fTI + module.SPM_LI);
                        break;
                    case "textarea":

                        UltraTextEditor _mBox = new UltraTextEditor();
                        _mBox.Location = new System.Drawing.Point(vXPosition, yPosition);
                        _mBox.Name = module.SPM_TPrefix + field.DCP_ControlID;
                        _mBox.Multiline = true;
                        _mBox.Size = areaSize;
                        _mBox.TabIndex = iTabInex++;
                        if (field.DCP_IsReadonly == 1)
                        {
                            _mBox.ReadOnly = true;
                        }
                        ctr.Controls.Add(_mBox);
                        break;
                    case "date":
                        UltraDateTimeEditor _dateCom = new UltraDateTimeEditor();
                        _dateCom.BackColor = System.Drawing.SystemColors.Window;
                        _dateCom.MaskInput = "yyyy-mm-dd";
                        _dateCom.SpinButtonDisplayStyle = Infragistics.Win.ButtonDisplayStyle.OnMouseEnter;
                        _dateCom.Location = new System.Drawing.Point(vXPosition, yPosition);
                        _dateCom.Name = module.SPM_TPrefix + field.DCP_ControlID;
                        _dateCom.Size = textSize;
                        _dateCom.TabIndex = iTabInex++;
                        _dateCom.Value = DateTime.Now;
                        _dateCom.PromptChar = ' ';
                        _dateCom.Nullable = true;
                        _dateCom.NullText = DateTime.Now.ToString();
                        if (field.DCP_IsReadonly == 1)
                        {
                            _dateCom.ReadOnly = true;
                        }
                        ctr.Controls.Add(_dateCom);
                        break;
                    case "time":
                        UltraDateTimeEditor _timeCom = new UltraDateTimeEditor();
                        _timeCom.BackColor = System.Drawing.SystemColors.Window;
                        _timeCom.MaskInput = "yyyy-mm-dd hh:mm";
                        _timeCom.SpinButtonDisplayStyle = Infragistics.Win.ButtonDisplayStyle.OnMouseEnter;
                        _timeCom.Location = new System.Drawing.Point(vXPosition, yPosition);
                        _timeCom.Name = module.SPM_TPrefix + field.DCP_ControlID;
                        _timeCom.Size = textSize;
                        _timeCom.TabIndex = iTabInex++;
                        _timeCom.Value = DateTime.Now;
                        _timeCom.PromptChar = ' ';
                        _timeCom.Nullable = true;
                        _timeCom.NullText = DateTime.Now.ToString();
                        if (field.DCP_IsReadonly == 1)
                        {
                            _timeCom.ReadOnly = true;
                        }
                        ctr.Controls.Add(_timeCom);
                        break;
                    case "dict":
                        UltraComboEditor _comEdit = new UltraComboEditor();
                        _comEdit.Location = new System.Drawing.Point(vXPosition, yPosition);
                        _comEdit.Name = module.SPM_TPrefix + field.DCP_ControlID;
                        _comEdit.Size = textSize;
                        _comEdit.TabIndex = iTabInex++;
                        _comEdit.DropDownStyle = DropDownStyle.DropDownList;
                        _comEdit.Tag = field;
                        if (field.DCP_IsReadonly == 1)
                        {
                            _comEdit.ReadOnly = true;
                        }
                        _comEdit.ValueChanged += new EventHandler(_comEdit_ValueChanged);

                        ctr.Controls.Add(_comEdit);
                        //ExcuteWithReturnValue ddd = new ExcuteWithReturnValue(this.SetDictValue);

                        //ddd.BeginInvoke(_comEdit, field.DCP_Type, null, null);
                        SetDictValue(_comEdit, field.DCP_Type);
                        break;
                    case "ref":
                        #region UltraGrid 界面设置

                        UltraCombo uCom = new UltraCombo();
                        #endregion
                        uCom.Location = new System.Drawing.Point(vXPosition, yPosition);
                        uCom.Name = module.SPM_TPrefix + field.DCP_ControlID;
                        uCom.Size = textSize;
                        uCom.TabIndex = iTabInex++;
                        uCom.Tag = field;
                        //uCom.Text =
                        ctr.Controls.Add(uCom);
                        //if (uCom.Value == null)
                        //{
                        //    uCom.Value = "";
                        //}

                        string sql = string.Empty;
                        if (!string.IsNullOrEmpty(field.DCP_RefSQL))
                        {
                            refModule = instRef.GetListByWhere(string.Format(" and SPR_RefModule='{0}'", field.DCP_RefSQL)).FirstOrDefault();//获取参考
                            if (refModule != null)
                            {
                                sql = string.Format(refModule.SPR_RefSQL.Trim(), "", "");
                                DataTable refDate = new DataTable();
                                refDate = instField.GetRefData(sql);
                                uCom.DataSource = refDate.DefaultView;
                                uCom.DisplayMember = refModule.SPR_RefData;
                                uCom.ValueMember = refModule.SPR_RefValue;
                            }
                        }
                        if (!string.IsNullOrEmpty(field.DCP_PControl))
                        {
                            uCom.Enabled = false;
                        }

                        uCom.ValueChanged += new EventHandler(uCom_ValueChanged);
                        //uCom.BeforeDropDown += new System.ComponentModel.CancelEventHandler(uCom_BeforeDropDown);
                        uCom.TextChanged += new EventHandler(uCom_TextChanged);
                        //uCom.LostFocus += new EventHandler(uCom_LostFocus);
                        //uCom.InitializeLayout += new InitializeLayoutEventHandler(uCom_InitializeLayout);

                        if (field.DCP_IsReadonly == 1)
                        {
                            uCom.ReadOnly = true;
                        }
                        break;
                }
                #endregion

                if (field.DCP_ControlType == "textarea" && step + 2 < module.SPM_CNum - 2)
                {
                    vXPosition += fTI;//
                    step++;
                }
                else if (field.DCP_ControlType == "textarea" && step + 2 > module.SPM_CNum - 2)
                {
                    step = module.SPM_CNum - 1;

                    if (field.DCP_TI != 0 && field.DCP_TX != 0 && field.DCP_TY != 0 && field.DCP_Height != 0)
                    {
                        yPosition += fHeight;
                    }
                    else
                    {
                        yPosition += fHeight * 2 - 14; ;
                    }
                }

                vXPosition += fTI;
                if (controlWidth < vXPosition)
                {
                    controlWidth = vXPosition;
                }
                if (controlHeight < yPosition + module.SPM_Height)
                {
                    controlHeight = yPosition + module.SPM_Height;
                }
                if (step == module.SPM_CNum - 1)
                {
                    step = 0;
                    vXPosition = xPosition;
                    yPosition += module.SPM_Height;
                }
                else
                {
                    step++;
                }
            }
            ctr.Height = controlHeight;
            Size point = new Size(controlWidth + 20, controlHeight + 10);
            ctr.KeyUp += new KeyEventHandler(ctr_KeyUp);
            return point;
        }
예제 #30
0
        void ResetChildControl(UltraCombo ccCom, Sys_PD_Filed field, string parentValue)
        {
            try
            {
                Sys_PD_Module module = ccCom.Parent.Tag as Sys_PD_Module;
                Sys_PD_Filed cField = new Sys_PD_Filed();
                Sys_PD_RefModule refModule = new Sys_PD_RefModule();

                string sql = string.Empty;
                if (ccCom != null) //如果是UltraCombo
                {
                    cField = ccCom.Tag as Sys_PD_Filed;

                    if (!string.IsNullOrEmpty(cField.DCP_RefSQL))
                    {
                        refModule = instRef.GetListByWhere(string.Format(" and SPR_RefModule='{0}'", cField.DCP_RefSQL)).FirstOrDefault();//获取参考
                        if (refModule != null)
                        {
                            sql = string.Format(refModule.SPR_RefSQL.Trim(), parentValue);
                            DataTable refDate = new DataTable();
                            refDate = instField.GetRefData(sql);
                            ccCom.DataSource = refDate.DefaultView;
                            ccCom.DisplayMember = refModule.SPR_RefData;
                            ccCom.ValueMember = refModule.SPR_RefValue;
                        }
                    }
                }
            }
            catch { }
        }
예제 #31
0
        void uCom_BeforeDropDown(object sender, System.ComponentModel.CancelEventArgs e)
        {
            UltraCombo uCom = sender as UltraCombo;
            //if (uCom.Value == null)
            //{
            //    uCom.Value = "";
            //}

            Sys_PD_Filed field = uCom.Tag as Sys_PD_Filed;
            Sys_PD_RefModule refModule = new Sys_PD_RefModule();
            refModule = instRef.GetListByWhere(string.Format(" and SPR_RefModule='{0}'", field.DCP_RefSQL)).FirstOrDefault();
            if (refModule == null)
            {
                return;
            }
            string sql = string.Empty;
            //处理有上级控件的情况
            if (!string.IsNullOrEmpty(field.DCP_PControl))
            {
                uCom.Enabled = true;
                Form frm = uCom.FindForm();

                UltraCombo ultra = new UltraCombo();
                UltraComboEditor ultrEditor = new UltraComboEditor();
                Control ct = new Control();
                string pValue = "";
                ct = frm.Controls.Find(field.DCP_PControl, true).FirstOrDefault();

                if (ct.GetType() == typeof(UltraCombo))
                {
                    ultra = ct as UltraCombo;
                    pValue = ultra.Value.ToString();
                }
                else if (ct.GetType() == typeof(UltraComboEditor))
                {
                    ultrEditor = ct as UltraComboEditor;
                    pValue = ultrEditor.Value.ToString();
                }
            }
            else
            {
            }
        }
        public static bool CheckValue(ArrayList clt, ErrorProvider error)
        {
            try
            {
                for (int i = 0; i < clt.Count; i++)
                {
                    Control txt = (Control)clt[i];
                    switch (txt.GetType().Name)
                    {
                    case "UltraTextEditor":
                    {
                        UltraTextEditor Ultratxt = txt as UltraTextEditor;
                        if (Ultratxt.Text == "")
                        {
                            error.SetError(Ultratxt, "loi");
                            Ultratxt.Focus();
                            return(false);
                        }
                        else
                        {
                            error.Clear();
                        }
                        break;
                    }

                    case "ComboBox":
                    {
                        ComboBox Ultratxt = txt as ComboBox;
                        if (Ultratxt.Text == "")
                        {
                            error.SetError(Ultratxt, "loi");
                            Ultratxt.Focus();
                            return(false);
                        }
                        else
                        {
                            error.Clear();
                        }
                        break;
                    }

                    case "TextBox":
                    {
                        TextBox textboxtxt = txt as TextBox;
                        if (textboxtxt.Text == "")
                        {
                            error.SetError(textboxtxt, "loi");
                            textboxtxt.Focus();
                            return(false);
                        }
                        else
                        {
                            error.Clear();
                        }
                        break;
                    }

                    case "UltraCombo":
                    {
                        UltraCombo textboxtxt = txt as UltraCombo;
                        if (textboxtxt.Text == "")
                        {
                            error.SetError(textboxtxt, "loi");
                            textboxtxt.Focus();
                            return(false);
                        }
                        else
                        {
                            error.Clear();
                        }
                        break;
                    }

                    case "UltraComboEditor":
                    {
                        UltraComboEditor textboxtxt = txt as UltraComboEditor;
                        if (textboxtxt.Text == "")
                        {
                            error.SetError(textboxtxt, "loi");
                            textboxtxt.Focus();
                            return(false);
                        }
                        else
                        {
                            error.Clear();
                        }
                        break;
                    }
                    }
                }
            }
            catch (Exception)
            {
                return(false);
            }
            return(true);
        }
예제 #33
0
        private bool WfIniTabPageUI(UltraTab pUTab, AdvanceQueryInfo pTabInfo)
        {
            Panel           panel;
            UltraGroupBox   UGroupBox;
            RadioButton     RadioAnd;
            RadioButton     RadioOr;
            UltraCombo      UComboColumn;
            UltraCombo      UComboCondition;
            UltraTextEditor UTextValue;
            UltraGrid       UGrid;

            try
            {
                //var pUTab = uTabControl.Tabs.Add("11");
                //pUTab.Text = "測試";
                panel        = new Panel();
                panel.Height = 100;
                panel.Dock   = DockStyle.Top;

                UGroupBox          = new UltraGroupBox();
                UGroupBox.Size     = new Size(160, 45);
                UGroupBox.Location = new Point(15, 10);
                UGroupBox.Text     = "且/或";
                if (GetStyleLibrary.FontControlNormal != null)
                {
                    UGroupBox.Font = GetStyleLibrary.FontControlNormal;
                }

                RadioAnd          = new RadioButton();
                RadioAnd.Checked  = true;
                RadioAnd.Size     = new Size(60, 20);
                RadioAnd.Location = new Point(20, 18);
                RadioAnd.Text     = "AND";
                if (GetStyleLibrary.FontControlNormal != null)
                {
                    RadioAnd.Font = GetStyleLibrary.FontControlNormal;
                }
                UGroupBox.Controls.Add(RadioAnd);

                RadioOr          = new RadioButton();
                RadioOr.Checked  = false;
                RadioOr.Size     = new Size(60, 20);
                RadioOr.Location = new Point(80, 18);
                RadioOr.Text     = "OR";
                if (GetStyleLibrary.FontControlNormal != null)
                {
                    RadioOr.Font = GetStyleLibrary.FontControlNormal;
                }
                UGroupBox.Controls.Add(RadioOr);
                panel.Controls.Add(UGroupBox);

                UComboColumn          = new UltraCombo();
                UComboColumn.Size     = new Size(160, 22);
                UComboColumn.Location = new Point(20, 60);
                if (GetStyleLibrary.FontControlNormal != null)
                {
                    UComboColumn.Font = GetStyleLibrary.FontControlNormal;
                }
                panel.Controls.Add(UComboColumn);

                UComboCondition          = new UltraCombo();
                UComboCondition.Size     = new Size(80, 22);
                UComboCondition.Location = new Point(190, 60);
                if (GetStyleLibrary.FontControlNormal != null)
                {
                    UComboCondition.Font = GetStyleLibrary.FontControlNormal;
                }
                panel.Controls.Add(UComboCondition);

                UTextValue          = new UltraTextEditor();
                UTextValue.Size     = new Size(260, 22);
                UTextValue.Location = new Point(280, 60);
                if (GetStyleLibrary.FontControlNormal != null)
                {
                    UTextValue.Font = GetStyleLibrary.FontControlNormal;
                }
                panel.Controls.Add(UTextValue);

                UGrid      = new UltraGrid();
                UGrid.Dock = DockStyle.Fill;

                pUTab.TabPage.Controls.Add(UGrid);
                pUTab.TabPage.Controls.Add(panel);

                //ref 到tab
                pTabInfo.UGroupBox       = UGroupBox;
                pTabInfo.RadioAnd        = RadioAnd;
                pTabInfo.RadioOr         = RadioOr;
                pTabInfo.UComboColumn    = UComboColumn;
                pTabInfo.UComboCondition = UComboCondition;
                pTabInfo.UTextValue      = UTextValue;
                pTabInfo.UGrid           = UGrid;

                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #34
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.ultraGroupBox1   = new Infragistics.Win.Misc.UltraGroupBox();
     this.ultraGroupBox4   = new Infragistics.Win.Misc.UltraGroupBox();
     this.cmbBeginDate2    = new Infragistics.Win.UltraWinEditors.UltraDateTimeEditor();
     this.chkBeginDate2    = new Infragistics.Win.UltraWinEditors.UltraCheckEditor();
     this.cmbEndDate2      = new Infragistics.Win.UltraWinEditors.UltraDateTimeEditor();
     this.chkEndDate2      = new Infragistics.Win.UltraWinEditors.UltraCheckEditor();
     this.ultraGroupBox3   = new Infragistics.Win.Misc.UltraGroupBox();
     this.cmbBeginDate     = new Infragistics.Win.UltraWinEditors.UltraDateTimeEditor();
     this.chkBeginDate     = new Infragistics.Win.UltraWinEditors.UltraCheckEditor();
     this.cmbEndDate       = new Infragistics.Win.UltraWinEditors.UltraDateTimeEditor();
     this.chkEndDate       = new Infragistics.Win.UltraWinEditors.UltraCheckEditor();
     this.txtJobName       = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
     this.ultraLabel1      = new Infragistics.Win.Misc.UltraLabel();
     this.btnQuery         = new Infragistics.Win.Misc.UltraButton();
     this.ultraGrid1       = new Infragistics.Win.UltraWinGrid.UltraGrid();
     this.ultraGroupBox2   = new Infragistics.Win.Misc.UltraGroupBox();
     this.ultraCombo1      = new Infragistics.Win.UltraWinGrid.UltraCombo();
     this.cmbBookEndDate   = new Infragistics.Win.UltraWinEditors.UltraDateTimeEditor();
     this.cmbBookBeginDate = new Infragistics.Win.UltraWinEditors.UltraDateTimeEditor();
     this.ultraLabel5      = new Infragistics.Win.Misc.UltraLabel();
     this.ultraLabel6      = new Infragistics.Win.Misc.UltraLabel();
     this.cmbEnd           = new Infragistics.Win.UltraWinEditors.UltraDateTimeEditor();
     this.cmbBegin         = new Infragistics.Win.UltraWinEditors.UltraDateTimeEditor();
     this.txtJobName2      = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
     this.ultraLabel2      = new Infragistics.Win.Misc.UltraLabel();
     this.ultraLabel3      = new Infragistics.Win.Misc.UltraLabel();
     this.ultraLabel4      = new Infragistics.Win.Misc.UltraLabel();
     this.ultraLabel7      = new Infragistics.Win.Misc.UltraLabel();
     this.btnOK            = new Infragistics.Win.Misc.UltraButton();
     this.btnCancel        = new Infragistics.Win.Misc.UltraButton();
     this.txtPrice         = new Infragistics.Win.Misc.UltraLabel();
     ((System.ComponentModel.ISupportInitialize)(this.ultraGroupBox1)).BeginInit();
     this.ultraGroupBox1.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.ultraGroupBox4)).BeginInit();
     this.ultraGroupBox4.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.cmbBeginDate2)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.cmbEndDate2)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.ultraGroupBox3)).BeginInit();
     this.ultraGroupBox3.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.cmbBeginDate)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.cmbEndDate)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.txtJobName)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.ultraGrid1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.ultraGroupBox2)).BeginInit();
     this.ultraGroupBox2.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.ultraCombo1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.cmbBookEndDate)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.cmbBookBeginDate)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.cmbEnd)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.cmbBegin)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.txtJobName2)).BeginInit();
     this.SuspendLayout();
     //
     // ultraGroupBox1
     //
     this.ultraGroupBox1.Controls.Add(this.ultraGroupBox4);
     this.ultraGroupBox1.Controls.Add(this.ultraGroupBox3);
     this.ultraGroupBox1.Controls.Add(this.txtJobName);
     this.ultraGroupBox1.Controls.Add(this.ultraLabel1);
     this.ultraGroupBox1.Controls.Add(this.btnQuery);
     this.ultraGroupBox1.Location = new System.Drawing.Point(208, 12);
     this.ultraGroupBox1.Name     = "ultraGroupBox1";
     this.ultraGroupBox1.Size     = new System.Drawing.Size(736, 161);
     this.ultraGroupBox1.TabIndex = 0;
     this.ultraGroupBox1.Text     = "招聘会信息修改";
     //
     // ultraGroupBox4
     //
     this.ultraGroupBox4.Controls.Add(this.cmbBeginDate2);
     this.ultraGroupBox4.Controls.Add(this.chkBeginDate2);
     this.ultraGroupBox4.Controls.Add(this.cmbEndDate2);
     this.ultraGroupBox4.Controls.Add(this.chkEndDate2);
     this.ultraGroupBox4.Location = new System.Drawing.Point(328, 61);
     this.ultraGroupBox4.Name     = "ultraGroupBox4";
     this.ultraGroupBox4.Size     = new System.Drawing.Size(296, 96);
     this.ultraGroupBox4.TabIndex = 18;
     this.ultraGroupBox4.Text     = "招聘会结束时间";
     //
     // cmbBeginDate2
     //
     this.cmbBeginDate2.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.VisualStudio2005;
     this.cmbBeginDate2.Location     = new System.Drawing.Point(136, 24);
     this.cmbBeginDate2.MaskInput    = "{date} {time}";
     this.cmbBeginDate2.Name         = "cmbBeginDate2";
     this.cmbBeginDate2.Size         = new System.Drawing.Size(144, 21);
     this.cmbBeginDate2.TabIndex     = 12;
     //
     // chkBeginDate2
     //
     this.chkBeginDate2.ButtonStyle = Infragistics.Win.UIElementButtonStyle.VisualStudio2005Button;
     this.chkBeginDate2.GlyphStyle  = Infragistics.Win.GlyphStyle.Office2007;
     this.chkBeginDate2.Location    = new System.Drawing.Point(16, 24);
     this.chkBeginDate2.Name        = "chkBeginDate2";
     this.chkBeginDate2.Size        = new System.Drawing.Size(120, 20);
     this.chkBeginDate2.TabIndex    = 14;
     this.chkBeginDate2.Text        = "开始时间";
     //
     // cmbEndDate2
     //
     this.cmbEndDate2.DateTime     = new System.DateTime(2008, 3, 10, 23, 59, 59, 0);
     this.cmbEndDate2.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.VisualStudio2005;
     this.cmbEndDate2.Location     = new System.Drawing.Point(136, 56);
     this.cmbEndDate2.MaskInput    = "{date} {time}";
     this.cmbEndDate2.Name         = "cmbEndDate2";
     this.cmbEndDate2.Size         = new System.Drawing.Size(144, 21);
     this.cmbEndDate2.TabIndex     = 13;
     this.cmbEndDate2.Value        = new System.DateTime(2008, 3, 10, 23, 59, 59, 0);
     //
     // chkEndDate2
     //
     this.chkEndDate2.ButtonStyle = Infragistics.Win.UIElementButtonStyle.VisualStudio2005Button;
     this.chkEndDate2.GlyphStyle  = Infragistics.Win.GlyphStyle.Office2007;
     this.chkEndDate2.Location    = new System.Drawing.Point(16, 56);
     this.chkEndDate2.Name        = "chkEndDate2";
     this.chkEndDate2.Size        = new System.Drawing.Size(120, 20);
     this.chkEndDate2.TabIndex    = 15;
     this.chkEndDate2.Text        = "结束时间";
     //
     // ultraGroupBox3
     //
     this.ultraGroupBox3.Controls.Add(this.cmbBeginDate);
     this.ultraGroupBox3.Controls.Add(this.chkBeginDate);
     this.ultraGroupBox3.Controls.Add(this.cmbEndDate);
     this.ultraGroupBox3.Controls.Add(this.chkEndDate);
     this.ultraGroupBox3.Location = new System.Drawing.Point(16, 61);
     this.ultraGroupBox3.Name     = "ultraGroupBox3";
     this.ultraGroupBox3.Size     = new System.Drawing.Size(296, 96);
     this.ultraGroupBox3.TabIndex = 17;
     this.ultraGroupBox3.Text     = "招聘会开始时间";
     //
     // cmbBeginDate
     //
     this.cmbBeginDate.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.VisualStudio2005;
     this.cmbBeginDate.Location     = new System.Drawing.Point(136, 24);
     this.cmbBeginDate.MaskInput    = "{date} {time}";
     this.cmbBeginDate.Name         = "cmbBeginDate";
     this.cmbBeginDate.Size         = new System.Drawing.Size(144, 21);
     this.cmbBeginDate.TabIndex     = 12;
     //
     // chkBeginDate
     //
     this.chkBeginDate.ButtonStyle = Infragistics.Win.UIElementButtonStyle.VisualStudio2005Button;
     this.chkBeginDate.GlyphStyle  = Infragistics.Win.GlyphStyle.Office2007;
     this.chkBeginDate.Location    = new System.Drawing.Point(16, 24);
     this.chkBeginDate.Name        = "chkBeginDate";
     this.chkBeginDate.Size        = new System.Drawing.Size(120, 20);
     this.chkBeginDate.TabIndex    = 14;
     this.chkBeginDate.Text        = "开始时间";
     //
     // cmbEndDate
     //
     this.cmbEndDate.DateTime     = new System.DateTime(2008, 3, 10, 23, 59, 59, 0);
     this.cmbEndDate.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.VisualStudio2005;
     this.cmbEndDate.Location     = new System.Drawing.Point(136, 56);
     this.cmbEndDate.MaskInput    = "{date} {time}";
     this.cmbEndDate.Name         = "cmbEndDate";
     this.cmbEndDate.Size         = new System.Drawing.Size(144, 21);
     this.cmbEndDate.TabIndex     = 13;
     this.cmbEndDate.Value        = new System.DateTime(2008, 3, 10, 23, 59, 59, 0);
     //
     // chkEndDate
     //
     this.chkEndDate.ButtonStyle = Infragistics.Win.UIElementButtonStyle.VisualStudio2005Button;
     this.chkEndDate.GlyphStyle  = Infragistics.Win.GlyphStyle.Office2007;
     this.chkEndDate.Location    = new System.Drawing.Point(16, 56);
     this.chkEndDate.Name        = "chkEndDate";
     this.chkEndDate.Size        = new System.Drawing.Size(120, 20);
     this.chkEndDate.TabIndex    = 15;
     this.chkEndDate.Text        = "结束时间";
     //
     // txtJobName
     //
     this.txtJobName.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.VisualStudio2005;
     this.txtJobName.Location     = new System.Drawing.Point(320, 21);
     this.txtJobName.Name         = "txtJobName";
     this.txtJobName.Size         = new System.Drawing.Size(224, 21);
     this.txtJobName.TabIndex     = 2;
     //
     // ultraLabel1
     //
     this.ultraLabel1.Location = new System.Drawing.Point(216, 21);
     this.ultraLabel1.Name     = "ultraLabel1";
     this.ultraLabel1.Size     = new System.Drawing.Size(100, 23);
     this.ultraLabel1.TabIndex = 1;
     this.ultraLabel1.Text     = "招聘会名称:";
     //
     // btnQuery
     //
     this.btnQuery.ButtonStyle = Infragistics.Win.UIElementButtonStyle.VisualStudio2005Button;
     this.btnQuery.Location    = new System.Drawing.Point(640, 61);
     this.btnQuery.Name        = "btnQuery";
     this.btnQuery.Size        = new System.Drawing.Size(75, 23);
     this.btnQuery.TabIndex    = 0;
     this.btnQuery.Text        = "查询";
     this.btnQuery.Click      += new System.EventHandler(this.btnQuery_Click);
     //
     // ultraGrid1
     //
     this.ultraGrid1.Location           = new System.Drawing.Point(12, 179);
     this.ultraGrid1.Name               = "ultraGrid1";
     this.ultraGrid1.Size               = new System.Drawing.Size(772, 360);
     this.ultraGrid1.TabIndex           = 1;
     this.ultraGrid1.Text               = "招聘会信息";
     this.ultraGrid1.InitializeLayout  += new Infragistics.Win.UltraWinGrid.InitializeLayoutEventHandler(this.ultraGrid1_InitializeLayout);
     this.ultraGrid1.AfterSelectChange += new Infragistics.Win.UltraWinGrid.AfterSelectChangeEventHandler(this.ultraGrid1_AfterSelectChange);
     //
     // ultraGroupBox2
     //
     this.ultraGroupBox2.Controls.Add(this.txtPrice);
     this.ultraGroupBox2.Controls.Add(this.ultraCombo1);
     this.ultraGroupBox2.Controls.Add(this.cmbBookEndDate);
     this.ultraGroupBox2.Controls.Add(this.cmbBookBeginDate);
     this.ultraGroupBox2.Controls.Add(this.ultraLabel5);
     this.ultraGroupBox2.Controls.Add(this.ultraLabel6);
     this.ultraGroupBox2.Controls.Add(this.cmbEnd);
     this.ultraGroupBox2.Controls.Add(this.cmbBegin);
     this.ultraGroupBox2.Controls.Add(this.txtJobName2);
     this.ultraGroupBox2.Controls.Add(this.ultraLabel2);
     this.ultraGroupBox2.Controls.Add(this.ultraLabel3);
     this.ultraGroupBox2.Controls.Add(this.ultraLabel4);
     this.ultraGroupBox2.Controls.Add(this.ultraLabel7);
     this.ultraGroupBox2.Controls.Add(this.btnOK);
     this.ultraGroupBox2.Controls.Add(this.btnCancel);
     this.ultraGroupBox2.Location = new System.Drawing.Point(790, 179);
     this.ultraGroupBox2.Name     = "ultraGroupBox2";
     this.ultraGroupBox2.Size     = new System.Drawing.Size(365, 384);
     this.ultraGroupBox2.TabIndex = 9;
     this.ultraGroupBox2.Text     = "招聘会信息修改";
     //
     // ultraCombo1
     //
     this.ultraCombo1.CharacterCasing   = System.Windows.Forms.CharacterCasing.Normal;
     this.ultraCombo1.DisplayStyle      = Infragistics.Win.EmbeddableElementDisplayStyle.Default;
     this.ultraCombo1.DropDownStyle     = Infragistics.Win.UltraWinGrid.UltraComboStyle.DropDownList;
     this.ultraCombo1.Location          = new System.Drawing.Point(152, 85);
     this.ultraCombo1.Name              = "ultraCombo1";
     this.ultraCombo1.Size              = new System.Drawing.Size(200, 22);
     this.ultraCombo1.TabIndex          = 31;
     this.ultraCombo1.ValueChanged     += new System.EventHandler(this.ultraCombo1_ValueChanged);
     this.ultraCombo1.InitializeLayout += new Infragistics.Win.UltraWinGrid.InitializeLayoutEventHandler(this.ultraCombo1_InitializeLayout);
     //
     // cmbBookEndDate
     //
     this.cmbBookEndDate.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.VisualStudio2005;
     this.cmbBookEndDate.Location     = new System.Drawing.Point(152, 260);
     this.cmbBookEndDate.MaskInput    = "{date} {time}";
     this.cmbBookEndDate.Name         = "cmbBookEndDate";
     this.cmbBookEndDate.Size         = new System.Drawing.Size(200, 21);
     this.cmbBookEndDate.TabIndex     = 30;
     //
     // cmbBookBeginDate
     //
     this.cmbBookBeginDate.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.VisualStudio2005;
     this.cmbBookBeginDate.Location     = new System.Drawing.Point(152, 220);
     this.cmbBookBeginDate.MaskInput    = "{date} {time}";
     this.cmbBookBeginDate.Name         = "cmbBookBeginDate";
     this.cmbBookBeginDate.Size         = new System.Drawing.Size(200, 21);
     this.cmbBookBeginDate.TabIndex     = 29;
     //
     // ultraLabel5
     //
     this.ultraLabel5.Location = new System.Drawing.Point(40, 220);
     this.ultraLabel5.Name     = "ultraLabel5";
     this.ultraLabel5.Size     = new System.Drawing.Size(96, 23);
     this.ultraLabel5.TabIndex = 27;
     this.ultraLabel5.Text     = "预订开始时间:";
     //
     // ultraLabel6
     //
     this.ultraLabel6.Location = new System.Drawing.Point(40, 260);
     this.ultraLabel6.Name     = "ultraLabel6";
     this.ultraLabel6.Size     = new System.Drawing.Size(104, 23);
     this.ultraLabel6.TabIndex = 28;
     this.ultraLabel6.Text     = "预订结束时间:";
     //
     // cmbEnd
     //
     this.cmbEnd.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.VisualStudio2005;
     this.cmbEnd.Location     = new System.Drawing.Point(152, 180);
     this.cmbEnd.MaskInput    = "{date} {time}";
     this.cmbEnd.Name         = "cmbEnd";
     this.cmbEnd.Size         = new System.Drawing.Size(200, 21);
     this.cmbEnd.TabIndex     = 26;
     //
     // cmbBegin
     //
     this.cmbBegin.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.VisualStudio2005;
     this.cmbBegin.Location     = new System.Drawing.Point(152, 140);
     this.cmbBegin.MaskInput    = "{date} {time}";
     this.cmbBegin.Name         = "cmbBegin";
     this.cmbBegin.Size         = new System.Drawing.Size(200, 21);
     this.cmbBegin.TabIndex     = 25;
     //
     // txtJobName2
     //
     this.txtJobName2.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.VisualStudio2005;
     this.txtJobName2.Location     = new System.Drawing.Point(152, 46);
     this.txtJobName2.Name         = "txtJobName2";
     this.txtJobName2.Size         = new System.Drawing.Size(200, 21);
     this.txtJobName2.TabIndex     = 20;
     //
     // ultraLabel2
     //
     this.ultraLabel2.Location = new System.Drawing.Point(48, 46);
     this.ultraLabel2.Name     = "ultraLabel2";
     this.ultraLabel2.Size     = new System.Drawing.Size(100, 23);
     this.ultraLabel2.TabIndex = 19;
     this.ultraLabel2.Text     = "招聘会名称:";
     //
     // ultraLabel3
     //
     this.ultraLabel3.Location = new System.Drawing.Point(48, 85);
     this.ultraLabel3.Name     = "ultraLabel3";
     this.ultraLabel3.Size     = new System.Drawing.Size(100, 23);
     this.ultraLabel3.TabIndex = 21;
     this.ultraLabel3.Text     = "所属服务产品:";
     //
     // ultraLabel4
     //
     this.ultraLabel4.Location = new System.Drawing.Point(32, 140);
     this.ultraLabel4.Name     = "ultraLabel4";
     this.ultraLabel4.Size     = new System.Drawing.Size(112, 23);
     this.ultraLabel4.TabIndex = 23;
     this.ultraLabel4.Text     = "招聘会开始时间:";
     //
     // ultraLabel7
     //
     this.ultraLabel7.Location = new System.Drawing.Point(32, 180);
     this.ultraLabel7.Name     = "ultraLabel7";
     this.ultraLabel7.Size     = new System.Drawing.Size(112, 23);
     this.ultraLabel7.TabIndex = 24;
     this.ultraLabel7.Text     = "招聘会结束时间:";
     //
     // btnOK
     //
     this.btnOK.ButtonStyle = Infragistics.Win.UIElementButtonStyle.VisualStudio2005Button;
     this.btnOK.Location    = new System.Drawing.Point(104, 307);
     this.btnOK.Name        = "btnOK";
     this.btnOK.Size        = new System.Drawing.Size(75, 23);
     this.btnOK.TabIndex    = 17;
     this.btnOK.Text        = "确定";
     this.btnOK.Click      += new System.EventHandler(this.btnOK_Click);
     //
     // btnCancel
     //
     this.btnCancel.ButtonStyle = Infragistics.Win.UIElementButtonStyle.VisualStudio2005Button;
     this.btnCancel.Location    = new System.Drawing.Point(232, 307);
     this.btnCancel.Name        = "btnCancel";
     this.btnCancel.Size        = new System.Drawing.Size(75, 23);
     this.btnCancel.TabIndex    = 18;
     this.btnCancel.Text        = "取消";
     this.btnCancel.Click      += new System.EventHandler(this.btnCancel_Click);
     //
     // txtPrice
     //
     this.txtPrice.Location = new System.Drawing.Point(152, 111);
     this.txtPrice.Name     = "txtPrice";
     this.txtPrice.Size     = new System.Drawing.Size(200, 23);
     this.txtPrice.TabIndex = 32;
     //
     // JobModify
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
     this.ClientSize          = new System.Drawing.Size(1183, 659);
     this.Controls.Add(this.ultraGroupBox2);
     this.Controls.Add(this.ultraGrid1);
     this.Controls.Add(this.ultraGroupBox1);
     this.Name  = "JobModify";
     this.Text  = "招聘会信息修改";
     this.Load += new System.EventHandler(this.JobModify_Load);
     ((System.ComponentModel.ISupportInitialize)(this.ultraGroupBox1)).EndInit();
     this.ultraGroupBox1.ResumeLayout(false);
     this.ultraGroupBox1.PerformLayout();
     ((System.ComponentModel.ISupportInitialize)(this.ultraGroupBox4)).EndInit();
     this.ultraGroupBox4.ResumeLayout(false);
     this.ultraGroupBox4.PerformLayout();
     ((System.ComponentModel.ISupportInitialize)(this.cmbBeginDate2)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.cmbEndDate2)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.ultraGroupBox3)).EndInit();
     this.ultraGroupBox3.ResumeLayout(false);
     this.ultraGroupBox3.PerformLayout();
     ((System.ComponentModel.ISupportInitialize)(this.cmbBeginDate)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.cmbEndDate)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.txtJobName)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.ultraGrid1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.ultraGroupBox2)).EndInit();
     this.ultraGroupBox2.ResumeLayout(false);
     this.ultraGroupBox2.PerformLayout();
     ((System.ComponentModel.ISupportInitialize)(this.ultraCombo1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.cmbBookEndDate)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.cmbBookBeginDate)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.cmbEnd)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.cmbBegin)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.txtJobName2)).EndInit();
     this.ResumeLayout(false);
 }
예제 #35
0
 public static void LoadcboLop(this UltraGridColumn @column)
 {
     var ultraCombo = new UltraCombo
     {
         ValueMember = "ID",
         DisplayMember = "MaLop"
     };
     ultraCombo.DisplayLayout.ScrollStyle = ScrollStyle.Immediate;
     ultraCombo.DisplayLayout.ScrollBounds = ScrollBounds.ScrollToFill;
     ultraCombo.Rows.Band.Columns["ID"].Hidden = true;
     ultraCombo.Rows.Band.Columns["IdKhoa"].Hidden = true;
     ultraCombo.Rows.Band.Columns["GhiChu"].Hidden = true;
     ultraCombo.Rows.Band.Columns["Khoa"].Hidden = true;
     ultraCombo.Rows.Band.Columns["MaLop"].Width = 200;
     ultraCombo.DropDownWidth = 0;
     ultraCombo.DisplayLayout.Bands[0].Columns["MaLop"].Header.Caption = @"Lớp";
     ultraCombo.DisplayLayout.Bands[0].Columns["MaLop"].SortIndicator = SortIndicator.Ascending;
     @column.EditorComponent = ultraCombo;
     //var a = (UltraCombo)@column.EditorComponent;
     //a.DisplayLayout.Bands[0].ColumnFilters["ID"].FilterConditions.Add(FilterComparisionOperator.Equals, 2);
     //a.DisplayLayout.Bands[0].ColumnFilters.ClearAllFilters();
 }
예제 #36
0
        public static void Combo_AfterSortChange(object sender, BandEventArgs e)
        {
            bool   flag = false;
            string text = string.Empty;

            if (((UltraCombo)sender).FindForm() == null)
            {
                return;
            }

            Label label = (Label)FindControl(((UltraCombo)sender).FindForm(), "lbldynamic" + ((UltraCombo)sender).FindForm().Name + ((UltraCombo)sender).Name);

            if (((UltraCombo)sender).DisplayMember != e.Band.SortedColumns[0].ToString())
            {
                if ((e.Band.SortedColumns[0].ToString() == ((UltraCombo)sender).DisplayLayout.Bands[0].Columns[((UltraCombo)sender).ValueMemberResolved].Key) | (e.Band.SortedColumns[0].ToString() == ((UltraCombo)sender).DisplayLayout.Bands[0].Columns[1].Key))
                {
                    if (label != null)
                    {
                        text = label.Text;
                    }
                    flag = true;
                }
            }
            else
            {
                text = Conversions.ToString(((UltraCombo)sender).Value);
                flag = true;
            }
            ((UltraCombo)sender).DisplayMember = e.Band.SortedColumns[0].ToString();
            ((UltraCombo)sender).PerformAction(UltraComboAction.FirstRow);
            UltraCombo combo = (UltraCombo)sender;

            if (label != null)
            {
                if (combo.ValueMember == combo.DisplayMember)
                {
                    if ((combo.DisplayLayout.Bands[0].Columns[combo.ValueMemberResolved].CellSizeResolved.Width + 0x23) > 420)
                    {
                        combo.Width = 420;
                    }
                    else
                    {
                        combo.Width = combo.DisplayLayout.Bands[0].Columns[combo.ValueMemberResolved].CellSizeResolved.Width + 0x23;
                    }
                    label.Left = ((combo.Left + combo.Width) + Conversions.ToInteger(Interaction.IIf(((UltraCombo)sender).Tag != null, 0x10, 0))) + 5;
                }
                else
                {
                    if ((combo.DisplayLayout.Bands[0].Columns[1].CellSizeResolved.Width + 0x23) > 420)
                    {
                        combo.Width = 420;
                    }
                    else
                    {
                        combo.Width = combo.DisplayLayout.Bands[0].Columns[1].CellSizeResolved.Width + 0x23;
                    }
                    label.Left = ((combo.Left + combo.Width) + Conversions.ToInteger(Interaction.IIf(((UltraCombo)sender).Tag != null, 0x10, 0))) + 5;
                }
                if (flag)
                {
                    ((UltraCombo)sender).Value = text;
                    ((UltraCombo)sender).PerformAction(UltraComboAction.ToggleDropdown);
                    ((UltraCombo)sender).PerformAction(UltraComboAction.Dropdown);
                }
                if (((UltraCombo)sender).SelectedRow == null)
                {
                    label.Text = "";
                }
                else if (((UltraCombo)sender).ValueMember == ((UltraCombo)sender).DisplayMember)
                {
                    label.Text = Conversions.ToString(((UltraCombo)sender).SelectedRow.Cells[1].Value);
                }
                else
                {
                    label.Text = Conversions.ToString(((UltraCombo)sender).SelectedRow.Cells[((UltraCombo)sender).ValueMemberResolved].Value);
                }
            }
        }
예제 #37
0
        public static void InicijalizirajCombo(UltraCombo combo, object PocetnaVrijednost = null, bool prikaziLabel = true, bool autoSize = true)
        {
            System.Drawing.Point point    = new System.Drawing.Point();
            ErrorProvider        provider = new ErrorProvider();

            combo.Tag                 = provider;
            combo.KeyPress           += new KeyPressEventHandler(InfraCustom.PretvoriEnterUTab);
            combo.Validating         += new CancelEventHandler(InfraCustom.Combo_Validating);
            combo.AfterSortChange    += new BandEventHandler(InfraCustom.Combo_AfterSortChange);
            combo.ItemNotInList      += new Infragistics.Win.UltraWinGrid.ItemNotInListEventHandler(InfraCustom.Combo_ItemNotInList);
            combo.KeyDown            += new KeyEventHandler(InfraCustom.Combo_KeyDown);
            combo.RowSelected        += new RowSelectedEventHandler(InfraCustom.combo_RowSelected);
            combo.AfterColPosChanged += new AfterColPosChangedEventHandler(InfraCustom.Combo_AfterColPosChanged);
            UcitajComboLayout(combo);

            Label label = new Label();

            if (prikaziLabel)
            {
                try
                {
                    label.Name = "lbldynamic" + combo.FindForm().Name + combo.Name;
                }
                catch (Exception)
                {
                    label.Name = "lbldynamic" + combo.Name;
                }
            }

            if (autoSize)
            {
                if (combo.ValueMember == combo.DisplayMember)
                {
                    if ((combo.DisplayLayout.Bands[0].Columns[combo.ValueMemberResolved].CellSizeResolved.Width + 0x23) > 600)
                    {
                        combo.Width = 600;
                    }
                    else
                    {
                        combo.Width = combo.DisplayLayout.Bands[0].Columns[combo.ValueMemberResolved].CellSizeResolved.Width + 0x23;
                    }
                }
                else if ((combo.DisplayLayout.Bands[0].Columns[1].CellSizeResolved.Width + 0x23) > 600)
                {
                    combo.Width = 600;
                }
                else
                {
                    combo.Width = combo.DisplayLayout.Bands[0].Columns[1].CellSizeResolved.Width + 0x23;
                }
            }

            if (PocetnaVrijednost == null)
            {
                if (prikaziLabel)
                {
                    if (combo.SelectedRow != null)
                    {
                        if (combo.ValueMember == combo.DisplayMember)
                        {
                            label.Text = Conversions.ToString(combo.SelectedRow.Cells[1].Value);
                        }
                        else
                        {
                            label.Text = Conversions.ToString(combo.SelectedRow.Cells[combo.ValueMemberResolved].Value);
                        }
                    }
                    else
                    {
                        label.Text = "";
                    }
                }
            }
            else
            {
                combo.SelectedRow = null;
                combo.Value       = RuntimeHelpers.GetObjectValue(PocetnaVrijednost);
            }

            if (prikaziLabel)
            {
                label.AutoSize = true;
                point.X        = ((combo.Location.X + combo.Width) + Conversions.ToInteger(Interaction.IIf(combo.Tag != null, 0x10, 0))) + 5;
                point.Y        = combo.Location.Y + 5;
                label.Location = point;
                combo.Parent.Controls.Add(label);
                label.BackColor = Color.Transparent;
            }
        }
        private static UltraCombo CboQuyen()
        {
            var ucQuyen = new UltraCombo();
            var table = new DataTable();
            table.Columns.Add("Quyen");
            table.Rows.Add("quantri");
            table.Rows.Add("nguoidung");

            ucQuyen.DataSource = table;
            ucQuyen.DisplayMember = "Quyen";
            ucQuyen.ValueMember = "Quyen";

            ucQuyen.DisplayLayout.ScrollStyle = ScrollStyle.Immediate;
            ucQuyen.DisplayLayout.ScrollBounds = ScrollBounds.ScrollToFill;
            ucQuyen.DropDownWidth = 0;
            ucQuyen.Rows.Band.ColHeadersVisible = false;
            ucQuyen.Rows.Band.Columns["Quyen"].Width = 250;
            return ucQuyen;
        }