//Hide/enable colum headers  (extended property of datatble column Enabled required)
        public static void HideEnableGridColumns(UltraGrid grid)
        {
            DataTable dtData = null;

            //Check data set
            if (grid.DataSource != null)
            {
                dtData = grid.DataSource as DataTable;
            }
            foreach (UltraGridBand band in grid.DisplayLayout.Bands)
            {
                foreach (UltraGridColumn col in band.Columns)
                {
                    //Check underscore in name
                    if (col.Header.Caption.Contains("__"))
                    {
                        col.Hidden = true;
                    }

                    //Check enable from datatable property
                    if (dtData == null || !dtData.Columns[col.Key].ExtendedProperties.ContainsKey("Enabled") ||
                        Convert.ToBoolean(dtData.Columns[col.Key].ExtendedProperties["Enabled"]) != true)
                    {
                        continue;
                    }
                    col.CellClickAction = CellClickAction.CellSelect;
                    col.CellActivation = Activation.NoEdit;
                }
            }
        }
示例#2
0
        public UltraGrid GenerateColumn(string moduleName, UltraGrid ug_list, Point p)
        {
            Sys_PD_Module module = new Sys_PD_Module();

            module = instModule.GetListByWhere(" and SPM_Module='" + moduleName + "'").ToList()[0];
            //List<Sys_PD_Filed> filedList = new List<Sys_PD_Filed>();
            //filedList = instField.GetListByWhere(" and DCP_ModuleName='" + moduleName + "' order by DCP_Order").ToList();
            GridTagObject gridObj = new GridTagObject();
            gridObj.Module = module;
            gridObj.GridValuePrefix = "";

            //UltraGrid ug_list = new Infragistics.Win.UltraWinGrid.UltraGrid();
            //ctr.Tag = module;
            ug_list.Location = p;
            ug_list.Name = module.SPM_LPrefix + module.SPM_Module;//grid的技术名称
            ug_list.Tag = gridObj;
            ug_list.Size = new System.Drawing.Size(module.SPM_LX, module.SPM_LY);
            ug_list.Dock = DockStyle.Fill;
            ug_list.Text = module.SPM_Name;
            ug_list.DisplayLayout.GroupByBox.Prompt = "请把要分组的列拖放到此处";
            #region 默认样式初始化
            GridFormater.SetGridStyle(ug_list);
            //ug_list.DisplayLayout.Override.AllowGroupBy = DefaultableBoolean.True;
            //ug_list.DisplayLayout.GroupByBox.Hidden = false;
            //ug_list.DisplayLayout.Override.GroupByColumnsHidden = DefaultableBoolean.False;
            #endregion

            ug_list.AfterColPosChanged += new AfterColPosChangedEventHandler(ug_list_AfterColPosChanged);
            ug_list.InitializeLayout += new InitializeLayoutEventHandler(ug_list_InitializeLayout);
            ug_list.KeyUp += new KeyEventHandler(ug_list_KeyUp);
            ug_list.CellChange += new CellEventHandler(ug_list_CellChange);
            ug_list.BeforeCellListDropDown += new CancelableCellEventHandler(ug_list_BeforeCellListDropDown);
            //ctr.Controls.Add(ug_list);
            return ug_list;
        }
示例#3
0
        public SceltaSegnaposto(UltraTextEditor inputControl, UltraGrid grid, Dictionary<string, string> listaValori)
        { 
            _inputControl = inputControl;
            _grid = grid;

            _listaSegnaPosto = new Infragistics.Win.UltraWinListView.UltraListView
            {
                Name = "segnaPosto",
                View = Infragistics.Win.UltraWinListView.UltraListViewStyle.List
            };
            _listaSegnaPosto.ItemSettings.Appearance.Image = Properties.Resources.check_small;
            _listaSegnaPosto.Size = new System.Drawing.Size(231, 97);
            _listaSegnaPosto.ItemDoubleClick += listaSegnaPostoItemDoubleClick;

            foreach (var kvp in listaValori)
            {
                var item = new Infragistics.Win.UltraWinListView.UltraListViewItem(kvp.Value, null, null) {Key = kvp.Key};
                _listaSegnaPosto.Items.Add(item);
            }

            _button = new DropDownEditorButton("SceltaSegnaposto") {RightAlignDropDown = DefaultableBoolean.True, Control = _listaSegnaPosto};
            _inputControl.ButtonsRight.Add(_button);
            _listaSegnaPosto.Height = 200;

            if(_grid != null)
                _grid.ClickCell += gridClickCell;
        }
示例#4
0
        public static void AddColumnButton(UltraGrid grid, int band, GridButton button)
        {
            var colName = button.ToString();
             var colWidth = button == GridButton.Edit ||
                        button == GridButton.Add
                           ? 34
                           : button == GridButton.Delete
                                ? 46
                                : button == GridButton.Override
                                     ? 60
                                     : 50;

             if (grid.DisplayLayout.Bands[band].Columns.IndexOf(colName) != -1) return;

             grid.DisplayLayout.Bands[band].Columns.Insert(grid.DisplayLayout.Bands[band].Columns.Count, colName);
             var gridColumn = grid.DisplayLayout.Bands[band].Columns[colName];
             gridColumn.ButtonDisplayStyle = Infragistics.Win.UltraWinGrid.ButtonDisplayStyle.Always;
             gridColumn.CellAppearance.TextHAlign = HAlign.Center;
             gridColumn.CellAppearance.FontData.Name = "Tahoma";
             gridColumn.CellAppearance.FontData.SizeInPoints = 8f;
             gridColumn.CellActivation = Activation.NoEdit;
             gridColumn.CellClickAction = CellClickAction.CellSelect;
             gridColumn.Header.Caption = "";
             gridColumn.Header.Enabled = false;
             gridColumn.RowLayoutColumnInfo.PreferredCellSize = new Size(colWidth, 18);
             gridColumn.Style = ColumnStyle.Button;
        }
示例#5
0
 public void InitControl()
 {
     List<Prod_Maintain> list = new List<Prod_Maintain>();
     comGrid = gen.GenerateGrid("CList_PMaintain", this.pnlGrid, new Point(0, 0));
     comGrid.DataSource = list;
     comGrid.DisplayLayout.Override.AllowAddNew = AllowAddNew.No;
 }
 public FrmSuaMaSinhVien(int masv, int idkythi, string made,UltraGrid ultra)
 {
     InitializeComponent();
     _ultra = ultra;
     _masv = masv;
     _idkythi = idkythi;
     _made = made;
 }
示例#7
0
 public void InitControl()
 {
     List<Prod_Components> list = new List<Prod_Components>();
     comGrid = gen.GenerateGrid("CList_OtherDoc", this.pnlGrid, new Point(0, 0));
     comGrid.DataSource = list;
     comGrid.DoubleClickRow += new DoubleClickRowEventHandler(comGrid_DoubleClickRow);
     comGrid.DisplayLayout.Override.AllowAddNew = AllowAddNew.No;
 }
示例#8
0
        public void InitControl()
        {
            gen = new GridHelper();

            pdInstance=new QX.BLL.Bll_Prod();
            comGrid = gen.GenerateGrid("CList_POut", this.pnlGrid, new Point(0, 0));
            List<Prod_Pool> list = new List<Prod_Pool>();
            comGrid.DataSource = list;
            comGrid.DisplayLayout.Override.AllowAddNew = AllowAddNew.No;
        }
示例#9
0
 public PrintHelper(UltraGrid ug)
 {
     this.uGridPrint = ug;
     this.uGridPrintDocument = new Infragistics.Win.UltraWinGrid.UltraGridPrintDocument();
     this.uPrintPreviewDialog = new Infragistics.Win.Printing.UltraPrintPreviewDialog();
     //
     // uPrintPreviewDialog
     //
     this.uPrintPreviewDialog.Name = "uPrintPreviewDialog";
 }
示例#10
0
 public void AssignETRoles(UltraGrid leftGrid,
     DataSetETRoles currentETRoles)
 {
     DataSetETRoles leftRoles = leftGrid.DataSource as DataSetETRoles;
     if (leftRoles == null) return;
     DataSetETRoles.ETTableRow[] dataRows = GetTickedDataRows(leftGrid, leftRoles);
     if (dataRows == null) return;
     this.MoveRowAndCreateNew(dataRows, currentETRoles);
     leftRoles.AcceptChanges();
 }
示例#11
0
 public void InitControl()
 {
     List<Prod_Pool> list = new List<Prod_Pool>();
     comGrid = gen.GenerateGrid("CList_POut", this.pnlDoc, new Point(0, 0));
     comGrid.DataSource = list;
     //comGrid.DoubleClickRow += new DoubleClickRowEventHandler(comGrid_DoubleClickRow);
     List<Prod_Pool> list1 = new List<Prod_Pool>();
     changedGrid = gen.GenerateGrid("CList_POut", this.pnlChange, new Point(0, 0));
     changedGrid.DataSource = list1;
 }
示例#12
0
        public void InitControl()
        {
            comGrid = gen.GenerateGrid("CList_CompleteCheck", this.pnlDoc, new Point(0, 0));

            DataTable dt = new BLL.Bll_Comm().ListViewData(string.Format("select * from VRpt_CompCheck where 1>2 "));
            comGrid.DataSource = dt;

            prodGrid = gen.GenerateGrid("CList_ProdCheck", this.panel1, new Point(0, 0));

            DataTable dt1 = new BLL.Bll_Comm().ListViewData(string.Format("select * from VRpt_ProdCheck where 1>2 "));
            prodGrid.DataSource = dt1;
        }
示例#13
0
 public void SetGridEditMode(bool flag, UltraGrid grid)
 {
     if (flag)
     {
         grid.DisplayLayout.Override.AllowAddNew = AllowAddNew.TemplateOnBottom;
         grid.DisplayLayout.Override.CellClickAction = CellClickAction.Edit;
     }
     else
     {
         grid.DisplayLayout.Override.AllowAddNew = AllowAddNew.No;
         grid.DisplayLayout.Override.CellClickAction = CellClickAction.RowSelect;
     }
 }
示例#14
0
        public static Point GetPositionForAddButton(UltraGrid grid)
        {
            var gridLoc = grid.Location;
             var colIdx = grid.DisplayLayout.Bands[0].Columns.Count - 1;
             var element = grid.DisplayLayout.Bands[0].Columns[colIdx].Header.GetUIElement();
             if(element != null) {
            var elementLoc = element.Rect.Location;
            var elementSize = element.Rect.Size;

            return new Point(elementLoc.X + elementSize.Width + gridLoc.X, elementLoc.Y + gridLoc.Y);
             }

             return new Point(gridLoc.X + grid.Size.Width, gridLoc.Y);
        }
示例#15
0
 public void InitControl()
 {
     //List<Prod_Pool> list = new List<Prod_Pool>();
     //comGrid = gen.GenerateGrid("CList_PPool", this.pnlGrid, new Point(0, 0));
     //comGrid.DataSource = list;
     //comGrid.DisplayLayout.Override.AllowAddNew = AllowAddNew.No;
     //List<Prod_Pool> list1 = new List<Prod_Pool>();
     //this.allGrid = gen.GenerateGrid("CList_POut", this.pnlAll, new Point(0, 0));
     //allGrid.DataSource = list1;
     comGrid = gen.GenerateGrid("CList_QueryOther", this.pnlDoc, new Point(0, 0));
     comGrid.DoubleClickRow += new DoubleClickRowEventHandler(comGrid_DoubleClickRow);
     DataTable dt = new BLL.Bll_Comm().ListViewData(string.Format("select * from VRpt_OtherQuery where 1>2 "));
     comGrid.DataSource = dt;
 }
        /*
         *
         Example Use

         var alistofitems = new List<string>()
            {
                "Material",
                "Additional"
            };
           PrepareValueListsClass.PrepareValueLists(utgBOM, e, alistofitems, "ItemType", ColumnStyle.DropDownList, true, "Material");

         *
         *
         */
        public static void PrepareValueLists(
            UltraGrid aGrid,
            InitializeLayoutEventArgs e,
            List<string> alistofitems,
            string itemName,
            ColumnStyle aColumnStyle,
            bool hasdefault = false,
            string adefaultValue = "")
        {
            if (!aGrid.DisplayLayout.ValueLists.Exists(itemName))
            {
                UltraGridColumn checkColumn = e.Layout.Bands[0].Columns.Add
                    (
                        itemName,
                        itemName);
                checkColumn.CellActivation = Activation.AllowEdit;
                checkColumn.Header.VisiblePosition = 0;

                ValueList svl = aGrid.DisplayLayout.ValueLists.Add(itemName);

                foreach (string alistofitem in alistofitems)
                {
                    svl.ValueListItems.Add
                        (
                            alistofitem,
                            alistofitem);
                }

                aGrid.DisplayLayout.Bands[0].Columns[itemName].ValueList = aGrid.DisplayLayout.ValueLists[itemName];
                aGrid.DisplayLayout.Bands[0].Columns[itemName].Style = aColumnStyle;
            }
            if (!hasdefault)
            {
                return;
            }
            foreach (UltraGridRow row in aGrid.Rows)
            {
                row.Cells[itemName].Value = adefaultValue;
            }
        }
示例#17
0
        public static void SetUltraGridCellReadOnly(ref UltraGrid ultraGrid, ArrayList alistColumns)
        {
            try
            {
                bool bReadOnly = false;

                for (int i = 0; i < ultraGrid.DisplayLayout.Bands[0].Columns.Count; i++)
                {
                    try
                    {
                        if (alistColumns == null || !alistColumns.Contains(ultraGrid.DisplayLayout.Bands[0].Columns[i].Key))
                        {
                            bReadOnly = false;
                        }
                        else
                        {
                            bReadOnly = true;
                        }

                        ultraGrid.DisplayLayout.Bands[0].Columns[i].CellActivation = (bReadOnly ? Activation.ActivateOnly : Activation.AllowEdit);
                        ultraGrid.DisplayLayout.Bands[0].Columns[i].CellAppearance.BackColor = (bReadOnly ? Color.Bisque : Color.White);
                    }
                    catch { }
                }
            }
            catch { }
        }
示例#18
0
 public static void SetUltraGridCellReadOnly(ref UltraGrid ultraGrid, bool bReadOnly)
 {
     try
     {
         for (int i = 0; i < ultraGrid.DisplayLayout.Bands[0].Columns.Count; i++)
         {
             try
             {
                 ultraGrid.DisplayLayout.Bands[0].Columns[i].CellActivation = (bReadOnly ? Activation.ActivateOnly : Activation.AllowEdit);
                 ultraGrid.DisplayLayout.Bands[0].Columns[i].CellAppearance.BackColor = (bReadOnly ? Color.Bisque : Color.White);
             }
             catch { }
         }
     }
     catch { }
 }
示例#19
0
        public static void SetUltraGridActiveCell(ref UltraGrid ultraGrid, int RowIndexNo, string ColumnName, bool EnterEditMode)
        {
            try
            {
                if (ultraGrid != null && RowIndexNo >= 0 && ultraGrid.Rows.Count >= RowIndexNo + 1)
                {
                    ultraGrid.ActiveCell = ultraGrid.Rows[RowIndexNo].Cells[ColumnName];

                    if (EnterEditMode)
                        ultraGrid.PerformAction(UltraGridAction.EnterEditMode);
                }
            }
            catch { }
        }
示例#20
0
        public static void ResetUltraDataSource(ref UltraDataSource ultDataSource, ref UltraGrid ultraGrid)
        {
            try
            {
                if (ultDataSource.Rows.Count == 0) return;

                for (int i = 0; i < ultDataSource.Band.Columns.Count; i++)
                {
                    try
                    {
                        if (ultDataSource.Band.Columns[i].DataType == typeof(Bitmap) ||
                            ultDataSource.Band.Columns[i].DataType == typeof(Image))
                            ultDataSource.Rows[0][i] = null;
                        else if (ultDataSource.Band.Columns[i].DataType == typeof(DateTime))
                            ultDataSource.Rows[0][i] = DBNull.Value;
                        else if (ultDataSource.Band.Columns[i].DataType == typeof(decimal) ||
                            ultDataSource.Band.Columns[i].DataType == typeof(double) ||
                            ultDataSource.Band.Columns[i].DataType == typeof(Single))
                            ultDataSource.Rows[0][i] = 0;
                        else
                            ultDataSource.Rows[0][i] = "";
                    }
                    catch { }
                }

                ultraGrid.UpdateData();
            }
            catch { }
        }
示例#21
0
        public static bool RecordLocation(ref UltraGrid ultraGrid, string strColumn, object value, out int iRowIndex)
        {
            iRowIndex = -1;

            try
            {
                if (ultraGrid != null && ultraGrid.Rows.Count > 0)
                {
                    for (int i = 0; i < ultraGrid.Rows.Count; i++)
                    {
                        if (ultraGrid.Rows[i].Cells[strColumn].Value == value)
                        {
                            iRowIndex = ultraGrid.Rows[i].Index;
                            return true;
                        }
                    }
                }
            }
            catch { }

            return false;
        }
示例#22
0
        public static void InitUserControl(ref UltraDataSource ultDataSource, ref UltraGrid ultraGrid)
        {
            try
            {
                int iColumnsCount = ultDataSource.Band.Columns.Count;
                object[] obj = new object[iColumnsCount];

                ultDataSource.Rows.Clear();

                for (int i = 0; i < ultDataSource.Band.Columns.Count; i++)
                {
                    try
                    {
                        if (ultDataSource.Band.Columns[i].DataType == typeof(Bitmap) ||
                            ultDataSource.Band.Columns[i].DataType == typeof(Image))
                            obj[i] = null;
                        else if (ultDataSource.Band.Columns[i].DataType == typeof(DateTime))
                            obj[i] = DBNull.Value;
                        else if (ultDataSource.Band.Columns[i].DataType == typeof(decimal) ||
                                ultDataSource.Band.Columns[i].DataType == typeof(double) ||
                                ultDataSource.Band.Columns[i].DataType == typeof(Single))
                            obj[i] = 0;
                        else
                            obj[i] = "";
                    }
                    catch { }

                    try
                    {
                        ultraGrid.DisplayLayout.Bands[0].Columns[i].Header.Appearance.FontData.Bold = DefaultableBoolean.False;
                    }
                    catch { }
                }

                ultDataSource.Rows.Add(obj);

                ultraGrid.UpdateData();
            }
            catch { }
        }
示例#23
0
        public static void ExportDataWithSaveDialog2(ref UltraGrid myGrid1, string strFileName)
        {
            try
            {
                if (myGrid1.Rows.Count == 0) return;

                if (strFileName.Length == 0)
                    strFileName = "未命名";

                SaveFileDialog dlg = new SaveFileDialog();
                dlg.Title = "保存";
                dlg.OverwritePrompt = true;
                dlg.Filter = "Excel文件(*.xls)|*.xls";
                dlg.AddExtension = true;
                dlg.FileName = strFileName;
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    strFileName = dlg.FileName;
                    ultraGridExcelExporter1.Export(myGrid1, strFileName);

                    if (MessageBox.Show("数据导出成功!\r\n需要打开所导出文件吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        ProcessStartInfo p = new ProcessStartInfo(strFileName);
                        p.WorkingDirectory = Path.GetDirectoryName(strFileName);
                        Process.Start(p);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
示例#24
0
        public static void ExportDataWithSaveDialog(ref UltraGrid ultraGrid1, string strFileName)
        {
            try
            {
                if (ultraGrid1.Rows.Count == 0) return;

                if (strFileName.Length == 0)
                    strFileName = "未命名";

                SaveFileDialog dlg = new SaveFileDialog();
                dlg.Title = "保存";
                dlg.OverwritePrompt = true;
                dlg.Filter = "Excel文件(*.xls)|*.xls";
                dlg.AddExtension = true;
                dlg.FileName = strFileName;

                string strCaption = strFileName;

                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    strFileName = dlg.FileName;

                    Workbook wb = new Workbook();
                    Worksheet ws2 = wb.Worksheets.Add("Sheet1");
                    WorksheetMergedCellsRegion region = null;

                    ws2.Rows[0].Cells[0].Value = strCaption;

                    ws2.Rows[0].Cells[0].CellFormat.Alignment = Infragistics.Excel.HorizontalCellAlignment.Center;
                    ws2.Rows[0].Cells[0].CellFormat.VerticalAlignment = Infragistics.Excel.VerticalCellAlignment.Center;
                    ws2.Rows[0].Cells[0].CellFormat.WrapText = Infragistics.Excel.ExcelDefaultableBoolean.True;
                    ws2.Rows[0].Cells[0].CellFormat.Font.Name = "宋体";
                    ws2.Rows[0].Cells[0].CellFormat.Font.Height = 350;
                    ws2.Rows[0].Cells[0].CellFormat.Font.Bold = ExcelDefaultableBoolean.True;
                    ws2.Rows[0].Height = 880;

                    int iMaxY = 0;
                    int iMaxHeight = 0;
                    int iMaxWidth = 0;
                    for (int i = 0; i < ultraGrid1.DisplayLayout.Bands[0].Columns.Count; i++)
                    {
                        if (!ultraGrid1.DisplayLayout.Bands[0].Columns[i].Hidden && ultraGrid1.DisplayLayout.Bands[0].Columns[i].RowLayoutColumnInfo.LabelPosition != LabelPosition.None)
                        {
                            try
                            {
                                ws2.Rows[1 + ultraGrid1.DisplayLayout.Bands[0].Columns[i].RowLayoutColumnInfo.OriginY].Cells[ultraGrid1.DisplayLayout.Bands[0].Columns[i].RowLayoutColumnInfo.OriginX].Value = ultraGrid1.DisplayLayout.Bands[0].Columns[i].Header.Caption;
                                ws2.Rows[1 + ultraGrid1.DisplayLayout.Bands[0].Columns[i].RowLayoutColumnInfo.OriginY].Cells[ultraGrid1.DisplayLayout.Bands[0].Columns[i].RowLayoutColumnInfo.OriginX].CellFormat.Alignment = Infragistics.Excel.HorizontalCellAlignment.Center;
                                ws2.Rows[1 + ultraGrid1.DisplayLayout.Bands[0].Columns[i].RowLayoutColumnInfo.OriginY].Cells[ultraGrid1.DisplayLayout.Bands[0].Columns[i].RowLayoutColumnInfo.OriginX].CellFormat.VerticalAlignment = Infragistics.Excel.VerticalCellAlignment.Center;
                                ws2.Rows[1 + ultraGrid1.DisplayLayout.Bands[0].Columns[i].RowLayoutColumnInfo.OriginY].Cells[ultraGrid1.DisplayLayout.Bands[0].Columns[i].RowLayoutColumnInfo.OriginX].CellFormat.WrapText = Infragistics.Excel.ExcelDefaultableBoolean.True;
                                ws2.Rows[1 + ultraGrid1.DisplayLayout.Bands[0].Columns[i].RowLayoutColumnInfo.OriginY].Cells[ultraGrid1.DisplayLayout.Bands[0].Columns[i].RowLayoutColumnInfo.OriginX].CellFormat.Font.Bold = Infragistics.Excel.ExcelDefaultableBoolean.True;
                                ws2.Rows[1 + ultraGrid1.DisplayLayout.Bands[0].Columns[i].RowLayoutColumnInfo.OriginY].Cells[ultraGrid1.DisplayLayout.Bands[0].Columns[i].RowLayoutColumnInfo.OriginX].CellFormat.WrapText = Infragistics.Excel.ExcelDefaultableBoolean.True;
                                ws2.Rows[1 + ultraGrid1.DisplayLayout.Bands[0].Columns[i].RowLayoutColumnInfo.OriginY].Cells[ultraGrid1.DisplayLayout.Bands[0].Columns[i].RowLayoutColumnInfo.OriginX].CellFormat.Font.Name = "宋体";

                                region = ws2.MergedCellsRegions.Add(1 + ultraGrid1.DisplayLayout.Bands[0].Columns[i].RowLayoutColumnInfo.OriginY,
                                      ultraGrid1.DisplayLayout.Bands[0].Columns[i].RowLayoutColumnInfo.OriginX,
                                      1 + ultraGrid1.DisplayLayout.Bands[0].Columns[i].RowLayoutColumnInfo.OriginY +
                                      ultraGrid1.DisplayLayout.Bands[0].Columns[i].RowLayoutColumnInfo.SpanY - 1,
                                      ultraGrid1.DisplayLayout.Bands[0].Columns[i].RowLayoutColumnInfo.OriginX +
                                      ultraGrid1.DisplayLayout.Bands[0].Columns[i].RowLayoutColumnInfo.SpanX - 1);

                                if (ws2.Rows[1 + ultraGrid1.DisplayLayout.Bands[0].Columns[i].RowLayoutColumnInfo.OriginY].Height != 500)
                                    ws2.Rows[1 + ultraGrid1.DisplayLayout.Bands[0].Columns[i].RowLayoutColumnInfo.OriginY].Height = 500;

                                if (ultraGrid1.DisplayLayout.Bands[0].Columns[i].RowLayoutColumnInfo.SpanY > iMaxHeight)
                                {
                                    iMaxHeight = ultraGrid1.DisplayLayout.Bands[0].Columns[i].RowLayoutColumnInfo.SpanY;
                                }

                                if (ultraGrid1.DisplayLayout.Bands[0].Columns[i].RowLayoutColumnInfo.OriginY > iMaxY)
                                {
                                    iMaxY = ultraGrid1.DisplayLayout.Bands[0].Columns[i].RowLayoutColumnInfo.OriginY;
                                    iMaxHeight = iMaxY + ultraGrid1.DisplayLayout.Bands[0].Columns[i].RowLayoutColumnInfo.SpanY;
                                }

                                if (ultraGrid1.DisplayLayout.Bands[0].Columns[i].RowLayoutColumnInfo.SpanX + ultraGrid1.DisplayLayout.Bands[0].Columns[i].RowLayoutColumnInfo.OriginX > iMaxWidth)
                                {
                                    iMaxWidth = ultraGrid1.DisplayLayout.Bands[0].Columns[i].RowLayoutColumnInfo.SpanX + ultraGrid1.DisplayLayout.Bands[0].Columns[i].RowLayoutColumnInfo.OriginX;
                                }
                            }
                            catch (Exception ex) { string str = ex.Message; }
                        }
                    }

                    region = ws2.MergedCellsRegions.Add(0, 0, 0, iMaxWidth - 1);

                    decimal dValue = 0.0M;
                    bool bDecimal = false;
                    for (int i = 0; i < ultraGrid1.Rows.Count; i++)
                    {
                        for (int j = 0; j < ultraGrid1.DisplayLayout.Bands[0].Columns.Count; j++)
                        {
                            try
                            {
                                if (!ultraGrid1.DisplayLayout.Bands[0].Columns[j].Hidden && ultraGrid1.DisplayLayout.Bands[0].Columns[j].RowLayoutColumnInfo.LabelPosition != LabelPosition.LabelOnly)
                                {
                                    if (decimal.TryParse(Convert.ToString(ultraGrid1.Rows[i].Cells[j].Text), out dValue))
                                    {
                                        if (dValue == 0 || dValue < 1 || !Convert.ToString(ultraGrid1.Rows[i].Cells[j].Text).StartsWith("0"))
                                        {
                                            bDecimal = true;
                                        }
                                        else
                                        {
                                            bDecimal = false;
                                        }
                                    }
                                    else
                                    {
                                        bDecimal = false;
                                    }

                                    if (bDecimal)
                                    {
                                        ws2.Rows[1 + iMaxHeight + i].Cells[ultraGrid1.DisplayLayout.Bands[0].Columns[j].RowLayoutColumnInfo.OriginX].Value = dValue;
                                    }
                                    else
                                    {
                                        ws2.Rows[1 + iMaxHeight + i].Cells[ultraGrid1.DisplayLayout.Bands[0].Columns[j].RowLayoutColumnInfo.OriginX].Value = ultraGrid1.Rows[i].Cells[j].Text;
                                    }
                                }
                            }
                            catch { }

                        }
                    }

                    BIFF8Writer.WriteWorkbookToFile(wb, strFileName);

                    if (File.Exists(strFileName) &&
                        MessageBox.Show("数据导出成功!\r\n需要打开所导出文件吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        ProcessStartInfo p = new ProcessStartInfo(strFileName);
                        p.WorkingDirectory = Path.GetDirectoryName(strFileName);
                        Process.Start(p);
                    }
                }
            }
            catch { }
        }
示例#25
0
        public static void SetUltraGridRowFilter(ref UltraGrid ultraGrid, bool bAllowFilter)
        {
            try
            {
                if (bAllowFilter)
                {
                    if (ultraGrid.DisplayLayout.Override.FilterUIType != FilterUIType.FilterRow)
                        ultraGrid.DisplayLayout.Override.FilterUIType = FilterUIType.FilterRow;

                    for (int i = 0; i < ultraGrid.DisplayLayout.Bands.Count; i++)
                    {
                        for (int j = 0; j < ultraGrid.DisplayLayout.Bands[i].Columns.Count; j++)
                        {
                            try
                            {
                                if (!ultraGrid.DisplayLayout.Bands[i].Columns[j].Hidden &&
                                    ultraGrid.DisplayLayout.Bands[i].Columns[j].RowLayoutColumnInfo.LabelPosition != LabelPosition.LabelOnly)
                                    ultraGrid.DisplayLayout.Bands[i].Columns[j].AllowRowFiltering = Infragistics.Win.DefaultableBoolean.True;
                            }
                            catch { }
                        }
                    }
                }
                else
                {
                    if (ultraGrid.DisplayLayout.Override.FilterUIType != FilterUIType.HeaderIcons)
                        ultraGrid.DisplayLayout.Override.FilterUIType = FilterUIType.HeaderIcons;

                    for (int i = 0; i < ultraGrid.DisplayLayout.Bands.Count; i++)
                    {
                        try
                        {
                            ultraGrid.DisplayLayout.Bands[i].ColumnFilters.ClearAllFilters();
                        }
                        catch { }

                        for (int j = 0; j < ultraGrid.DisplayLayout.Bands[i].Columns.Count; j++)
                        {
                            try
                            {
                                ultraGrid.DisplayLayout.Bands[i].Columns[j].AllowRowFiltering = Infragistics.Win.DefaultableBoolean.False;
                            }
                            catch { }
                        }
                    }
                }
            }
            catch { }
        }
示例#26
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     Infragistics.Win.Appearance appearance1 = new Infragistics.Win.Appearance();
     Infragistics.Win.Appearance appearance3 = new Infragistics.Win.Appearance();
     Infragistics.Win.Appearance appearance4 = new Infragistics.Win.Appearance();
     Infragistics.Win.UltraWinGrid.UltraGridBand   ultraGridBand1   = new Infragistics.Win.UltraWinGrid.UltraGridBand("Band 0", -1);
     Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn1 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("CardNumber");
     Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn2 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("TotalCredit", 0);
     Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn3 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("UsedCredit", 1);
     Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn4 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("OverAmount", 2);
     Infragistics.Win.Appearance appearance5 = new Infragistics.Win.Appearance();
     Infragistics.Win.Appearance appearance6 = new Infragistics.Win.Appearance();
     Infragistics.Win.Appearance appearance7 = new Infragistics.Win.Appearance();
     Infragistics.Win.Appearance appearance8 = new Infragistics.Win.Appearance();
     Infragistics.Win.Appearance appearance9 = new Infragistics.Win.Appearance();
     Infragistics.Win.UltraWinGrid.UltraGridBand   ultraGridBand2   = new Infragistics.Win.UltraWinGrid.UltraGridBand("Band 0", -1);
     Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn5 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("Reference");
     Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn6 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("ProductID", 0);
     Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn7 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("Quantity", 1);
     Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn8 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("Date", 2, null, 0, Infragistics.Win.UltraWinGrid.SortIndicator.Ascending, false);
     Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn9 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("Description", 3);
     Infragistics.Win.Appearance appearance10 = new Infragistics.Win.Appearance();
     Infragistics.Win.Appearance appearance11 = new Infragistics.Win.Appearance();
     Infragistics.Win.Appearance appearance12 = new Infragistics.Win.Appearance();
     Infragistics.Win.Appearance appearance13 = new Infragistics.Win.Appearance();
     this.ultraGroupBox1 = new Signature.Windows.Forms.GroupBox();
     this.label3         = new System.Windows.Forms.Label();
     this.txtRangeEnd    = new Signature.Windows.Forms.MaskedEdit();
     this.txtAmount      = new Signature.Windows.Forms.MaskedEdit();
     this.label2         = new System.Windows.Forms.Label();
     this.txtCardSetID   = new Signature.Windows.Forms.MaskedEdit();
     this.label1         = new System.Windows.Forms.Label();
     this.txtRangeStart  = new Signature.Windows.Forms.MaskedEdit();
     this.label9         = new System.Windows.Forms.Label();
     this.ultraGroupBox2 = new Signature.Windows.Forms.GroupBox();
     this.Grid           = new Infragistics.Win.UltraWinGrid.UltraGrid();
     this.bSubmit        = new System.Windows.Forms.Button();
     this.bCancel        = new System.Windows.Forms.Button();
     this.GridDetail     = new Infragistics.Win.UltraWinGrid.UltraGrid();
     ((System.ComponentModel.ISupportInitialize)(this.ultraGroupBox1)).BeginInit();
     this.ultraGroupBox1.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.ultraGroupBox2)).BeginInit();
     this.ultraGroupBox2.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.Grid)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.GridDetail)).BeginInit();
     this.SuspendLayout();
     //
     // txtStatus
     //
     this.txtStatus.Location = new System.Drawing.Point(0, 694);
     this.txtStatus.Size     = new System.Drawing.Size(633, 29);
     //
     // ultraGroupBox1
     //
     this.ultraGroupBox1.AllowDrop         = true;
     appearance1.AlphaLevel                = ((short)(95));
     appearance1.BackColor                 = System.Drawing.Color.Transparent;
     this.ultraGroupBox1.Appearance        = appearance1;
     this.ultraGroupBox1.BackColorInternal = System.Drawing.SystemColors.GradientInactiveCaption;
     this.ultraGroupBox1.Controls.Add(this.label3);
     this.ultraGroupBox1.Controls.Add(this.txtRangeEnd);
     this.ultraGroupBox1.Controls.Add(this.txtAmount);
     this.ultraGroupBox1.Controls.Add(this.label2);
     this.ultraGroupBox1.Controls.Add(this.txtCardSetID);
     this.ultraGroupBox1.Controls.Add(this.label1);
     this.ultraGroupBox1.Controls.Add(this.txtRangeStart);
     this.ultraGroupBox1.Controls.Add(this.label9);
     this.ultraGroupBox1.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this.ultraGroupBox1.Location  = new System.Drawing.Point(9, 1);
     this.ultraGroupBox1.Name      = "ultraGroupBox1";
     this.ultraGroupBox1.Size      = new System.Drawing.Size(621, 95);
     this.ultraGroupBox1.TabIndex  = 12;
     this.ultraGroupBox1.ViewStyle = Infragistics.Win.Misc.GroupBoxViewStyle.Office2007;
     //
     // label3
     //
     this.label3.BackColor = System.Drawing.Color.Transparent;
     this.label3.Location  = new System.Drawing.Point(465, 59);
     this.label3.Name      = "label3";
     this.label3.Size      = new System.Drawing.Size(20, 19);
     this.label3.TabIndex  = 19;
     this.label3.Text      = "-";
     this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
     //
     // txtRangeEnd
     //
     this.txtRangeEnd.AllowDrop   = true;
     this.txtRangeEnd.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(171)))), ((int)(((byte)(173)))), ((int)(((byte)(179)))));
     this.txtRangeEnd.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
     this.txtRangeEnd.Location    = new System.Drawing.Point(500, 58);
     this.txtRangeEnd.Name        = "txtCustomerID";
     this.txtRangeEnd.Size        = new System.Drawing.Size(102, 20);
     this.txtRangeEnd.TabIndex    = 14;
     //
     // txtAmount
     //
     this.txtAmount.AllowDrop   = true;
     this.txtAmount.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(171)))), ((int)(((byte)(173)))), ((int)(((byte)(179)))));
     this.txtAmount.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
     this.txtAmount.Location    = new System.Drawing.Point(129, 58);
     this.txtAmount.Name        = "txtCustomerID";
     this.txtAmount.Size        = new System.Drawing.Size(102, 20);
     this.txtAmount.TabIndex    = 17;
     //
     // label2
     //
     this.label2.BackColor = System.Drawing.Color.Transparent;
     this.label2.Location  = new System.Drawing.Point(49, 58);
     this.label2.Name      = "label2";
     this.label2.Size      = new System.Drawing.Size(62, 19);
     this.label2.TabIndex  = 18;
     this.label2.Text      = "Amount:";
     this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
     //
     // txtCardSetID
     //
     this.txtCardSetID.AllowDrop   = true;
     this.txtCardSetID.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(171)))), ((int)(((byte)(173)))), ((int)(((byte)(179)))));
     this.txtCardSetID.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
     this.txtCardSetID.Location    = new System.Drawing.Point(129, 25);
     this.txtCardSetID.Name        = "txtCustomerID";
     this.txtCardSetID.Size        = new System.Drawing.Size(102, 20);
     this.txtCardSetID.TabIndex    = 0;
     this.txtCardSetID.KeyUp      += new System.Windows.Forms.KeyEventHandler(this.txtCustomerID_KeyUp);
     //
     // label1
     //
     this.label1.BackColor = System.Drawing.Color.Transparent;
     this.label1.Location  = new System.Drawing.Point(6, 25);
     this.label1.Name      = "label1";
     this.label1.Size      = new System.Drawing.Size(105, 19);
     this.label1.TabIndex  = 16;
     this.label1.Text      = "Card Set #:";
     this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
     //
     // txtRangeStart
     //
     this.txtRangeStart.AllowDrop   = true;
     this.txtRangeStart.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(171)))), ((int)(((byte)(173)))), ((int)(((byte)(179)))));
     this.txtRangeStart.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
     this.txtRangeStart.Location    = new System.Drawing.Point(357, 58);
     this.txtRangeStart.Name        = "txtCustomerID";
     this.txtRangeStart.Size        = new System.Drawing.Size(102, 20);
     this.txtRangeStart.TabIndex    = 1;
     this.txtRangeStart.KeyUp      += new System.Windows.Forms.KeyEventHandler(this.txtCustomerID_KeyUp);
     //
     // label9
     //
     this.label9.BackColor = System.Drawing.Color.Transparent;
     this.label9.Location  = new System.Drawing.Point(277, 58);
     this.label9.Name      = "label9";
     this.label9.Size      = new System.Drawing.Size(62, 19);
     this.label9.TabIndex  = 13;
     this.label9.Text      = "Range:";
     this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
     //
     // ultraGroupBox2
     //
     this.ultraGroupBox2.AllowDrop = true;
     this.ultraGroupBox2.Anchor    = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                           | System.Windows.Forms.AnchorStyles.Left)));
     appearance3.AlphaLevel                = ((short)(95));
     appearance3.BackColor                 = System.Drawing.Color.Transparent;
     this.ultraGroupBox2.Appearance        = appearance3;
     this.ultraGroupBox2.BackColorInternal = System.Drawing.SystemColors.GradientInactiveCaption;
     this.ultraGroupBox2.Controls.Add(this.Grid);
     this.ultraGroupBox2.Controls.Add(this.bSubmit);
     this.ultraGroupBox2.Controls.Add(this.bCancel);
     this.ultraGroupBox2.Controls.Add(this.GridDetail);
     this.ultraGroupBox2.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this.ultraGroupBox2.Location  = new System.Drawing.Point(9, 102);
     this.ultraGroupBox2.Name      = "ultraGroupBox2";
     this.ultraGroupBox2.Size      = new System.Drawing.Size(621, 583);
     this.ultraGroupBox2.TabIndex  = 13;
     this.ultraGroupBox2.ViewStyle = Infragistics.Win.Misc.GroupBoxViewStyle.Office2007;
     //
     // Grid
     //
     appearance4.BackColor = System.Drawing.Color.White;
     this.Grid.DisplayLayout.Appearance      = appearance4;
     ultraGridColumn1.Header.Caption         = "Card Number";
     ultraGridColumn1.Header.VisiblePosition = 0;
     ultraGridColumn1.SortIndicator          = Infragistics.Win.UltraWinGrid.SortIndicator.Disabled;
     ultraGridColumn1.Width                  = 141;
     ultraGridColumn2.CellActivation         = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
     ultraGridColumn2.Header.VisiblePosition = 3;
     ultraGridColumn2.MaskDisplayMode        = Infragistics.Win.UltraWinMaskedEdit.MaskMode.IncludeLiterals;
     ultraGridColumn2.MaskInput              = "{LOC}nnnnnnn.nnn";
     ultraGridColumn2.SortIndicator          = Infragistics.Win.UltraWinGrid.SortIndicator.Disabled;
     ultraGridColumn2.Width                  = 153;
     ultraGridColumn3.CellActivation         = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
     ultraGridColumn3.Format                 = "";
     ultraGridColumn3.Header.VisiblePosition = 1;
     ultraGridColumn3.MaskDisplayMode        = Infragistics.Win.UltraWinMaskedEdit.MaskMode.IncludeLiterals;
     ultraGridColumn3.MaskInput              = "{LOC}nnnnnnn.nnn";
     ultraGridColumn3.SortIndicator          = Infragistics.Win.UltraWinGrid.SortIndicator.Disabled;
     ultraGridColumn3.Width                  = 156;
     ultraGridColumn4.Header.VisiblePosition = 2;
     ultraGridColumn4.MaskDisplayMode        = Infragistics.Win.UltraWinMaskedEdit.MaskMode.IncludeLiterals;
     ultraGridColumn4.MaskInput              = "{LOC}nnnnnnn.nnn";
     ultraGridColumn4.SortIndicator          = Infragistics.Win.UltraWinGrid.SortIndicator.Disabled;
     ultraGridColumn4.Width                  = 142;
     ultraGridBand1.Columns.AddRange(new object[] {
         ultraGridColumn1,
         ultraGridColumn2,
         ultraGridColumn3,
         ultraGridColumn4
     });
     this.Grid.DisplayLayout.BandsSerializer.Add(ultraGridBand1);
     this.Grid.DisplayLayout.BorderStyle         = Infragistics.Win.UIElementBorderStyle.Dashed;
     this.Grid.DisplayLayout.GroupByBox.Hidden   = true;
     this.Grid.DisplayLayout.MaxColScrollRegions = 1;
     this.Grid.DisplayLayout.MaxRowScrollRegions = 1;
     appearance5.BackColor = System.Drawing.Color.Transparent;
     this.Grid.DisplayLayout.Override.CardAreaAppearance = appearance5;
     this.Grid.DisplayLayout.Override.CellClickAction    = Infragistics.Win.UltraWinGrid.CellClickAction.EditAndSelectText;
     appearance6.BackColor             = System.Drawing.Color.FromArgb(((int)(((byte)(89)))), ((int)(((byte)(135)))), ((int)(((byte)(214)))));
     appearance6.BackColor2            = System.Drawing.Color.FromArgb(((int)(((byte)(7)))), ((int)(((byte)(59)))), ((int)(((byte)(150)))));
     appearance6.BackGradientStyle     = Infragistics.Win.GradientStyle.Vertical;
     appearance6.FontData.BoldAsString = "True";
     appearance6.FontData.Name         = "Arial";
     appearance6.FontData.SizeInPoints = 10F;
     appearance6.ForeColor             = System.Drawing.Color.White;
     appearance6.ThemedElementAlpha    = Infragistics.Win.Alpha.Transparent;
     this.Grid.DisplayLayout.Override.HeaderAppearance  = appearance6;
     this.Grid.DisplayLayout.Override.HeaderClickAction = Infragistics.Win.UltraWinGrid.HeaderClickAction.SortMulti;
     appearance7.BackColor         = System.Drawing.Color.FromArgb(((int)(((byte)(89)))), ((int)(((byte)(135)))), ((int)(((byte)(214)))));
     appearance7.BackColor2        = System.Drawing.Color.FromArgb(((int)(((byte)(7)))), ((int)(((byte)(59)))), ((int)(((byte)(150)))));
     appearance7.BackGradientStyle = Infragistics.Win.GradientStyle.Vertical;
     this.Grid.DisplayLayout.Override.RowSelectorAppearance = appearance7;
     this.Grid.DisplayLayout.Override.RowSelectors          = Infragistics.Win.DefaultableBoolean.False;
     appearance8.BackColor         = System.Drawing.Color.FromArgb(((int)(((byte)(251)))), ((int)(((byte)(230)))), ((int)(((byte)(148)))));
     appearance8.BackColor2        = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(149)))), ((int)(((byte)(21)))));
     appearance8.BackGradientStyle = Infragistics.Win.GradientStyle.Vertical;
     this.Grid.DisplayLayout.Override.SelectedRowAppearance = appearance8;
     this.Grid.DisplayLayout.ScrollBounds  = Infragistics.Win.UltraWinGrid.ScrollBounds.ScrollToFill;
     this.Grid.DisplayLayout.ScrollStyle   = Infragistics.Win.UltraWinGrid.ScrollStyle.Immediate;
     this.Grid.DisplayLayout.ViewStyleBand = Infragistics.Win.UltraWinGrid.ViewStyleBand.OutlookGroupBy;
     this.Grid.Font     = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.Grid.Location = new System.Drawing.Point(6, 10);
     this.Grid.Name     = "Grid";
     this.Grid.Size     = new System.Drawing.Size(609, 379);
     this.Grid.TabIndex = 16;
     this.Grid.Enter   += new System.EventHandler(this.Grid_Enter);
     this.Grid.MouseUp += new System.Windows.Forms.MouseEventHandler(this.Grid_MouseUp);
     this.Grid.KeyUp   += new System.Windows.Forms.KeyEventHandler(this.txtCustomerID_KeyUp);
     //
     // bSubmit
     //
     this.bSubmit.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                 | System.Windows.Forms.AnchorStyles.Left)));
     this.bSubmit.Location = new System.Drawing.Point(399, 545);
     this.bSubmit.Name     = "bSubmit";
     this.bSubmit.Size     = new System.Drawing.Size(124, 26);
     this.bSubmit.TabIndex = 15;
     this.bSubmit.Text     = "Save";
     this.bSubmit.UseVisualStyleBackColor = true;
     this.bSubmit.Visible = false;
     this.bSubmit.Click  += new System.EventHandler(this.bSubmit_Click);
     //
     // bCancel
     //
     this.bCancel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                 | System.Windows.Forms.AnchorStyles.Left)));
     this.bCancel.Location = new System.Drawing.Point(215, 545);
     this.bCancel.Name     = "bCancel";
     this.bCancel.Size     = new System.Drawing.Size(124, 26);
     this.bCancel.TabIndex = 14;
     this.bCancel.Text     = "Cancel";
     this.bCancel.UseVisualStyleBackColor = true;
     this.bCancel.Click += new System.EventHandler(this.bCancel_Click);
     //
     // GridDetail
     //
     appearance9.BackColor = System.Drawing.Color.White;
     this.GridDetail.DisplayLayout.Appearance = appearance9;
     ultraGridColumn5.CellActivation          = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
     ultraGridColumn5.Header.VisiblePosition  = 4;
     ultraGridColumn5.Width                  = 103;
     ultraGridColumn6.CellActivation         = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
     ultraGridColumn6.Header.Caption         = "Item ID";
     ultraGridColumn6.Header.VisiblePosition = 0;
     ultraGridColumn6.Width                  = 92;
     ultraGridColumn7.CellActivation         = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
     ultraGridColumn7.Format                 = "";
     ultraGridColumn7.Header.VisiblePosition = 2;
     ultraGridColumn7.MaskInput              = "";
     ultraGridColumn7.Width                  = 83;
     ultraGridColumn8.CellActivation         = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
     ultraGridColumn8.Header.VisiblePosition = 3;
     ultraGridColumn8.Width                  = 135;
     ultraGridColumn9.CellActivation         = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
     ultraGridColumn9.Header.VisiblePosition = 1;
     ultraGridColumn9.Width                  = 321;
     ultraGridBand2.Columns.AddRange(new object[] {
         ultraGridColumn5,
         ultraGridColumn6,
         ultraGridColumn7,
         ultraGridColumn8,
         ultraGridColumn9
     });
     this.GridDetail.DisplayLayout.BandsSerializer.Add(ultraGridBand2);
     this.GridDetail.DisplayLayout.BorderStyle         = Infragistics.Win.UIElementBorderStyle.Dashed;
     this.GridDetail.DisplayLayout.GroupByBox.Hidden   = true;
     this.GridDetail.DisplayLayout.MaxColScrollRegions = 1;
     this.GridDetail.DisplayLayout.MaxRowScrollRegions = 1;
     appearance10.BackColor = System.Drawing.Color.Transparent;
     this.GridDetail.DisplayLayout.Override.CardAreaAppearance = appearance10;
     this.GridDetail.DisplayLayout.Override.CellClickAction    = Infragistics.Win.UltraWinGrid.CellClickAction.EditAndSelectText;
     appearance11.BackColor             = System.Drawing.Color.FromArgb(((int)(((byte)(89)))), ((int)(((byte)(135)))), ((int)(((byte)(214)))));
     appearance11.BackColor2            = System.Drawing.Color.FromArgb(((int)(((byte)(7)))), ((int)(((byte)(59)))), ((int)(((byte)(150)))));
     appearance11.BackGradientStyle     = Infragistics.Win.GradientStyle.Vertical;
     appearance11.FontData.BoldAsString = "True";
     appearance11.FontData.Name         = "Arial";
     appearance11.FontData.SizeInPoints = 10F;
     appearance11.ForeColor             = System.Drawing.Color.White;
     appearance11.ThemedElementAlpha    = Infragistics.Win.Alpha.Transparent;
     this.GridDetail.DisplayLayout.Override.HeaderAppearance  = appearance11;
     this.GridDetail.DisplayLayout.Override.HeaderClickAction = Infragistics.Win.UltraWinGrid.HeaderClickAction.SortMulti;
     appearance12.BackColor         = System.Drawing.Color.FromArgb(((int)(((byte)(89)))), ((int)(((byte)(135)))), ((int)(((byte)(214)))));
     appearance12.BackColor2        = System.Drawing.Color.FromArgb(((int)(((byte)(7)))), ((int)(((byte)(59)))), ((int)(((byte)(150)))));
     appearance12.BackGradientStyle = Infragistics.Win.GradientStyle.Vertical;
     this.GridDetail.DisplayLayout.Override.RowSelectorAppearance = appearance12;
     this.GridDetail.DisplayLayout.Override.RowSelectors          = Infragistics.Win.DefaultableBoolean.False;
     appearance13.BackColor         = System.Drawing.Color.FromArgb(((int)(((byte)(251)))), ((int)(((byte)(230)))), ((int)(((byte)(148)))));
     appearance13.BackColor2        = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(149)))), ((int)(((byte)(21)))));
     appearance13.BackGradientStyle = Infragistics.Win.GradientStyle.Vertical;
     this.GridDetail.DisplayLayout.Override.SelectedRowAppearance = appearance13;
     this.GridDetail.DisplayLayout.ScrollBounds  = Infragistics.Win.UltraWinGrid.ScrollBounds.ScrollToFill;
     this.GridDetail.DisplayLayout.ScrollStyle   = Infragistics.Win.UltraWinGrid.ScrollStyle.Immediate;
     this.GridDetail.DisplayLayout.ViewStyleBand = Infragistics.Win.UltraWinGrid.ViewStyleBand.OutlookGroupBy;
     this.GridDetail.Font     = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.GridDetail.Location = new System.Drawing.Point(6, 395);
     this.GridDetail.Name     = "GridDetail";
     this.GridDetail.Size     = new System.Drawing.Size(609, 132);
     this.GridDetail.TabIndex = 17;
     //
     // frmCardSet
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.BackColor           = System.Drawing.Color.AliceBlue;
     this.ClientSize          = new System.Drawing.Size(633, 723);
     this.Controls.Add(this.ultraGroupBox2);
     this.Controls.Add(this.ultraGroupBox1);
     this.Name          = "frmCardSet";
     this.ShowInTaskbar = false;
     this.Text          = "Card Set WLOT";
     this.Load         += new System.EventHandler(this.frmOrder_Load);
     this.Closing      += new System.ComponentModel.CancelEventHandler(this.frmOrder_Closing);
     this.Controls.SetChildIndex(this.txtStatus, 0);
     this.Controls.SetChildIndex(this.ultraGroupBox1, 0);
     this.Controls.SetChildIndex(this.ultraGroupBox2, 0);
     ((System.ComponentModel.ISupportInitialize)(this.ultraGroupBox1)).EndInit();
     this.ultraGroupBox1.ResumeLayout(false);
     this.ultraGroupBox1.PerformLayout();
     ((System.ComponentModel.ISupportInitialize)(this.ultraGroupBox2)).EndInit();
     this.ultraGroupBox2.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.Grid)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.GridDetail)).EndInit();
     this.ResumeLayout(false);
 }
示例#27
0
 //Interface
 public UltraGridSvc(UltraGrid grid) : this(grid, null, null)
 {
 }
示例#28
0
 /// <summary>
 /// Highight ô có dữ liệu không hợp lệ
 /// </summary>
 /// <param name="grid">UltraGrid cần kiểm tra</param>
 /// <param name="inputTypes">Danh sách kiểu tương ứng với từng cột</param>
 /// <returns>True nếu có lỗi</returns>
 public static bool UltraGrid(UltraGrid grid, IList<InputType> inputTypes)
 {
     var result = false;
     foreach (var row in grid.Rows)
     {
         if (!result)
             result = UltraGrid(row, inputTypes);
         else
             UltraGrid(row, inputTypes);
     }
     return result;
 }
示例#29
0
 public SlowScroller(UltraGrid grid)
 {
     grd = grid;
     t   = new System.Windows.Forms.Timer();
 }
示例#30
0
        public static bool UltraGridContainsColumn(ref UltraGrid grid, int BandIndex, string strColumn)
        {
            if (grid == null || grid.DisplayLayout.Bands[BandIndex].Columns.Count <= 0)
                return false;

            if (BandIndex <= grid.DisplayLayout.Bands.Count - 1)
            {
                for (int i = 0; i < grid.DisplayLayout.Bands[BandIndex].Columns.Count; i++)
                {
                    if (grid.DisplayLayout.Bands[BandIndex].Columns[i].Key.Equals(strColumn))
                        return true;
                }
            }

            return false;
        }
示例#31
0
 public UltraGridSvc(UltraGrid grid, TextBox textBox) : this(grid, textBox, null)
 {
 }
示例#32
0
        private void GridInit()
        {
            GridHelper gen = new GridHelper();

            List<Sys_Map> bsList = new List<Sys_Map>();
            string moduleCode = DataCode;
            bsList = dcInstance.GetMap(ModuleCode);

            //ADOSys_PD_Module moduleInstance = new ADOSys_PD_Module();
            //Sys_PD_Module module = new Sys_PD_Module();
            //module = moduleInstance.GetListByWhere(" and SPM_Module='" + DataCode + "'").FirstOrDefault();
            //if (module == null)
            //{
            //    moduleCode = "CList_BseDict";
            //}

            comGrid = gen.GenerateGrid(moduleCode, this.pnlGrid, new Point(6, 20));
            comGrid.DisplayLayout.Override.AllowAddNew = AllowAddNew.TemplateOnBottom;
            BindingSource dataSource = new BindingSource();
            dataSource.DataSource = bsList;

            comGrid.DataSource = dataSource;

            //SetGridEditMode(false, StationGrid);

            //列宽度自适应
            comGrid.DisplayLayout.AutoFitStyle = AutoFitStyle.ExtendLastColumn;
            comGrid.Text = this.Text;
        }
示例#33
0
        private void AuditGridInit()
        {
            ////ControlGen.ContrlGenerate gen = new BC.ControlGen.ContrlGenerate();
            GridHelper gen = new GridHelper();

            List<VerifyProcess_Records> list = new List<VerifyProcess_Records>();

            list= adInstance.VerfiyProcessRecords(ModuleCode, DataCode);

            //list = re.ToList();

            comGrid = gen.GenerateGrid("CList_GAuditHistory", this.gpHis, new Point(6, 20));

            //BindingSource dataSource = new BindingSource();
            //dataSource.DataSource = list;

            comGrid.DataSource = list;

            SetGridEditMode(false, comGrid);

            ////列宽度自适应
            comGrid.DisplayLayout.AutoFitStyle = AutoFitStyle.ResizeAllColumns;

            Bll_Sys_Map mapInst = new Bll_Sys_Map();
            MapSource = mapInst.GetListByCode(string.Format(" AND Map_Module='{0}'", "Failure"));
        }
示例#34
0
        private void Init()
        {
            Bll_Sys_Map mapInst = new Bll_Sys_Map();
            Map = mapInst.GetModel(string.Format(" AND Map_Module='{0}' AND Map_Source='{0}'", "SmsTemplate"));

            Bll_Audit auditInst = new Bll_Audit();
            TemlateKey = auditInst.GetTemplateModel(ModuleCode);

            GridHelper gen = new GridHelper();
            uGridUser = gen.GenerateGrid("CList_VUser", this.panel1, new Point(6, 20));

            var dt = adInstance.GetNextVerifyUser(AuditNode, SessionConfig.UserCode);
            uGridUser.DataSource = dt;
            uGridUser.DoubleClickRow += new DoubleClickRowEventHandler(uGridUser_DoubleClickRow);
            gen.SetGridReadOnly(uGridUser, true);
            gen.SetGridColumnStyle(uGridUser, AutoFitStyle.ResizeAllColumns);

            AddCustomCol();
        }
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     Infragistics.Win.UltraWinGrid.UltraGridBand   ultraGridBand1   = new Infragistics.Win.UltraWinGrid.UltraGridBand("Band 0", -1);
     Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn1 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("user");
     Infragistics.Win.UltraWinGrid.UltraGridColumn ultraGridColumn2 = new Infragistics.Win.UltraWinGrid.UltraGridColumn("RepID", 0);
     Infragistics.Win.Appearance appearance2 = new Infragistics.Win.Appearance();
     this.ImageList1 = new System.Windows.Forms.ImageList(this.components);
     this.Label1     = new System.Windows.Forms.Label();
     this.panel1     = new System.Windows.Forms.Panel();
     this.Grid       = new Infragistics.Win.UltraWinGrid.UltraGrid();
     this.GroupBox1  = new Signature.Windows.Forms.GroupBox();
     this.txtSearch  = new Signature.Windows.Forms.MaskedEdit();
     this.btnClose   = new Signature.Windows.Forms.Button();
     this.Label23    = new System.Windows.Forms.Label();
     this.pbar       = new System.Windows.Forms.ProgressBar();
     this.panel1.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.Grid)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.GroupBox1)).BeginInit();
     this.GroupBox1.SuspendLayout();
     this.SuspendLayout();
     //
     // ImageList1
     //
     this.ImageList1.ColorDepth       = System.Windows.Forms.ColorDepth.Depth32Bit;
     this.ImageList1.ImageSize        = new System.Drawing.Size(15, 15);
     this.ImageList1.TransparentColor = System.Drawing.Color.Transparent;
     //
     // Label1
     //
     this.Label1.BackColor = System.Drawing.SystemColors.ActiveCaption;
     this.Label1.Dock      = System.Windows.Forms.DockStyle.Top;
     this.Label1.Font      = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.Label1.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
     this.Label1.Location  = new System.Drawing.Point(0, 0);
     this.Label1.Name      = "Label1";
     this.Label1.Size      = new System.Drawing.Size(277, 6);
     this.Label1.TabIndex  = 0;
     //
     // panel1
     //
     this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
     this.panel1.Controls.Add(this.Grid);
     this.panel1.Controls.Add(this.GroupBox1);
     this.panel1.Controls.Add(this.Label23);
     this.panel1.Controls.Add(this.pbar);
     this.panel1.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.panel1.Location = new System.Drawing.Point(0, 6);
     this.panel1.Name     = "panel1";
     this.panel1.Size     = new System.Drawing.Size(277, 615);
     this.panel1.TabIndex = 1;
     //
     // Grid
     //
     this.Grid.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                              | System.Windows.Forms.AnchorStyles.Right)));
     ultraGridColumn1.AutoEdit               = false;
     ultraGridColumn1.CellActivation         = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
     ultraGridColumn1.Header.VisiblePosition = 0;
     ultraGridColumn1.Width                  = 134;
     ultraGridColumn2.AutoEdit               = false;
     ultraGridColumn2.CellActivation         = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
     ultraGridColumn2.Header.VisiblePosition = 1;
     ultraGridColumn2.Width                  = 70;
     ultraGridBand1.Columns.AddRange(new object[] {
         ultraGridColumn1,
         ultraGridColumn2
     });
     this.Grid.DisplayLayout.BandsSerializer.Add(ultraGridBand1);
     this.Grid.DisplayLayout.Override.RowSelectors = Infragistics.Win.DefaultableBoolean.False;
     this.Grid.Location = new System.Drawing.Point(9, 77);
     this.Grid.Name     = "Grid";
     this.Grid.Size     = new System.Drawing.Size(255, 524);
     this.Grid.TabIndex = 86;
     this.Grid.KeyUp   += new System.Windows.Forms.KeyEventHandler(this.txtControl_KeyUp);
     this.Grid.MouseUp += new System.Windows.Forms.MouseEventHandler(this.DataGrid_MouseUp);
     //
     // GroupBox1
     //
     this.GroupBox1.AllowDrop = true;
     this.GroupBox1.Anchor    = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                      | System.Windows.Forms.AnchorStyles.Right)));
     appearance2.AlphaLevel           = ((short)(95));
     appearance2.BackColor            = System.Drawing.Color.Transparent;
     this.GroupBox1.Appearance        = appearance2;
     this.GroupBox1.BackColorInternal = System.Drawing.SystemColors.GradientInactiveCaption;
     this.GroupBox1.Controls.Add(this.txtSearch);
     this.GroupBox1.Controls.Add(this.btnClose);
     this.GroupBox1.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this.GroupBox1.Location  = new System.Drawing.Point(0, 12);
     this.GroupBox1.Name      = "GroupBox1";
     this.GroupBox1.Size      = new System.Drawing.Size(272, 42);
     this.GroupBox1.TabIndex  = 83;
     this.GroupBox1.ViewStyle = Infragistics.Win.Misc.GroupBoxViewStyle.Office2007;
     //
     // txtSearch
     //
     this.txtSearch.AllowDrop = true;
     this.txtSearch.Anchor    = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                       | System.Windows.Forms.AnchorStyles.Left)
                                                                      | System.Windows.Forms.AnchorStyles.Right)));
     this.txtSearch.BorderColor  = System.Drawing.Color.FromArgb(((int)(((byte)(171)))), ((int)(((byte)(173)))), ((int)(((byte)(179)))));
     this.txtSearch.BorderStyle  = System.Windows.Forms.BorderStyle.FixedSingle;
     this.txtSearch.Location     = new System.Drawing.Point(14, 12);
     this.txtSearch.Name         = "txtSearch";
     this.txtSearch.Size         = new System.Drawing.Size(156, 20);
     this.txtSearch.TabIndex     = 0;
     this.txtSearch.TextChanged += new System.EventHandler(this.txtSearch_TextChanged_1);
     this.txtSearch.KeyUp       += new System.Windows.Forms.KeyEventHandler(this.txtControl_KeyUp);
     //
     // btnClose
     //
     this.btnClose.AllowDrop  = true;
     this.btnClose.Anchor     = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     this.btnClose.BackColor  = System.Drawing.Color.LightSteelBlue;
     this.btnClose.Cursor     = System.Windows.Forms.Cursors.Hand;
     this.btnClose.Font       = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.btnClose.ForeColor  = System.Drawing.Color.Black;
     this.btnClose.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
     this.btnClose.Location   = new System.Drawing.Point(191, 11);
     this.btnClose.Name       = "btnClose";
     this.btnClose.Size       = new System.Drawing.Size(56, 24);
     this.btnClose.TabIndex   = 67;
     this.btnClose.Tag        = "";
     this.btnClose.Text       = "Close";
     this.btnClose.Click     += new System.EventHandler(this.btnClose_Click);
     //
     // Label23
     //
     this.Label23.BackColor = System.Drawing.SystemColors.ActiveCaption;
     this.Label23.Dock      = System.Windows.Forms.DockStyle.Top;
     this.Label23.Font      = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.Label23.ForeColor = System.Drawing.SystemColors.ActiveCaption;
     this.Label23.Location  = new System.Drawing.Point(0, 0);
     this.Label23.Name      = "Label23";
     this.Label23.Size      = new System.Drawing.Size(275, 10);
     this.Label23.TabIndex  = 84;
     this.Label23.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // pbar
     //
     this.pbar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                              | System.Windows.Forms.AnchorStyles.Right)));
     this.pbar.Location = new System.Drawing.Point(-4, 59);
     this.pbar.Name     = "pbar";
     this.pbar.Size     = new System.Drawing.Size(276, 10);
     this.pbar.TabIndex = 85;
     //
     // frmVieweMails
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize        = new System.Drawing.Size(277, 621);
     this.Controls.Add(this.panel1);
     this.Controls.Add(this.Label1);
     this.Name          = "frmVieweMails";
     this.ShowIcon      = false;
     this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
     this.Text          = "eMail Users View";
     this.TopMost       = true;
     this.Load         += new System.EventHandler(this.frmCustomerView_Load);
     this.panel1.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.Grid)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.GroupBox1)).EndInit();
     this.GroupBox1.ResumeLayout(false);
     this.GroupBox1.PerformLayout();
     this.ResumeLayout(false);
 }