Example #1
0
 private void autoSizeAllColumns(UltraGridBand b)
 {
     foreach (UltraGridColumn c in b.Columns)
     {
         c.PerformAutoResize(PerformAutoSizeType.VisibleRows, true);
     }
 }
Example #2
0
        private void dgvHorizontes_InitializeLayout(object sender, InitializeLayoutEventArgs e)
        {
            UltraGridBand band = e.Layout.Bands[0];

            //band.Columns[(int)ColumnasHorizontes.Code].Hidden = true;
            band.Columns[(int)ColumnasHorizontes.Reporte].Hidden = true;
            band.Columns[(int)ColumnasHorizontes.Code].Width     = 50;

            band.Columns[(int)ColumnasHorizontes.Origen].Width  = 120;
            band.Columns[(int)ColumnasHorizontes.Destino].Width = 120;
            band.Columns[(int)ColumnasHorizontes.Activo].Width  = 50;

            band.Columns[(int)ColumnasHorizontes.Origen].CellActivation  = Activation.NoEdit;
            band.Columns[(int)ColumnasHorizontes.Destino].CellActivation = Activation.NoEdit;

            band.Columns[(int)ColumnasHorizontes.oA].Header.Caption = "A";
            band.Columns[(int)ColumnasHorizontes.oB].Header.Caption = "B";
            band.Columns[(int)ColumnasHorizontes.oC].Header.Caption = "C";

            band.Columns[(int)ColumnasHorizontes.dA].Header.Caption = "A";
            band.Columns[(int)ColumnasHorizontes.dB].Header.Caption = "B";
            band.Columns[(int)ColumnasHorizontes.dC].Header.Caption = "C";

            band.Columns[(int)ColumnasHorizontes.oA].Width = 80;
            band.Columns[(int)ColumnasHorizontes.oB].Width = 80;
            band.Columns[(int)ColumnasHorizontes.oC].Width = 80;

            band.Columns[(int)ColumnasHorizontes.dA].Width = 80;
            band.Columns[(int)ColumnasHorizontes.dB].Width = 80;
            band.Columns[(int)ColumnasHorizontes.dC].Width = 80;
        }
Example #3
0
        private void componentsGrid_DemandLoad(object sender, Infragistics.WebUI.UltraWebGrid.RowEventArgs e)
        {
            Business.ApplicationComponent comp = (Business.ApplicationComponent)appComponents[(int)e.Row.Cells.FromKey("Id").Value];
            if (comp != null)
            {
                e.Row.Expanded = true;
                UltraGridBand band = componentsGrid.Bands[e.Row.BandIndex + 1];

                if (comp.DatabaseComponentId >= 0)
                {
                    Business.ApplicationComponent dbComp = comp.DatabaseComponent;
                    UltraGridRow newRow = new UltraGridRow(new object[] { comp.DatabaseComponentId, dbComp.Name, dbComp.Type, dbComp.Description });
                    e.Row.Rows.Add(newRow);

                    newRow.ShowExpand = (dbComp.DatabaseComponentId >= 0 || dbComp.HardwareComponentId >= 0);
                }

                if (comp.HardwareComponentId >= 0)
                {
                    Business.ApplicationComponent hwComp = comp.HardwareComponent;
                    UltraGridRow newRow = new UltraGridRow(new object[] { comp.HardwareComponentId, hwComp.Name, hwComp.Type, hwComp.Description });
                    e.Row.Rows.Add(newRow);

                    newRow.ShowExpand = (hwComp.DatabaseComponentId >= 0 || hwComp.HardwareComponentId >= 0);
                }
            }

            if (componentsGrid.Bands[e.Row.BandIndex + 1] == null)
            {
                AddBand(componentsGrid);
            }
        }
Example #4
0
        private void InitialGrid()
        {
            //dt.PrimaryKey = new DataColumn[] { dt.Columns["權證代號"] };
            //ultraGrid1.DataSource = dt;
            UltraGridBand bands0 = ultraGrid1.DisplayLayout.Bands[0];

            bands0.Columns["IssueNum"].Format = "N0";
            bands0.Columns["SoldNum"].Format  = "N0";

            bands0.Columns["WarrantID"].Width       = 90;
            bands0.Columns["WarrantName"].Width     = 135;
            bands0.Columns["IssueNum"].Width        = 90;
            bands0.Columns["SoldNum"].Width         = 90;
            bands0.Columns["Last1Sold"].Width       = 70;
            bands0.Columns["Last2Sold"].Width       = 70;
            bands0.Columns["Last3Sold"].Width       = 70;
            bands0.Columns["LastTradingDate"].Width = 90;
            //ultraGrid1.DisplayLayout.Bands[0].Columns["ReIssuable"].Width = 90;
            //ultraGrid1.DisplayLayout.Bands[0].Columns["維護時間"].Width = 120;
            ultraGrid1.DisplayLayout.AutoFitStyle = AutoFitStyle.ResizeAllColumns;

            bands0.Override.HeaderAppearance.TextHAlign = Infragistics.Win.HAlign.Left;
            bands0.Override.AllowAddNew = Infragistics.Win.UltraWinGrid.AllowAddNew.No;
            bands0.Override.AllowDelete = Infragistics.Win.DefaultableBoolean.False;
            bands0.Override.AllowUpdate = Infragistics.Win.DefaultableBoolean.False;

            SetButton();
        }
        public void SetUltraGrid(System.Data.DataTable dt, UltraGrid grid)
        {
            dt.Columns.Add("時間", typeof(string));
            dt.Columns.Add("內容", typeof(string));
            dt.Columns.Add("人員", typeof(string));
            grid.DataSource = dt;

            UltraGridBand band0 = grid.DisplayLayout.Bands[0];

            band0.Columns["時間"].Width = 60;
            band0.Columns["人員"].Width = 30;
            //ultraGrid1.DisplayLayout.Bands[0].Override.HeaderAppearance.TextHAlign = Infragistics.Win.HAlign.Left;
            band0.ColHeadersVisible         = false;
            grid.DisplayLayout.AutoFitStyle = AutoFitStyle.ResizeAllColumns;
            grid.DisplayLayout.Override.CellAppearance.BorderAlpha = Alpha.Transparent;
            grid.DisplayLayout.Override.RowAppearance.BorderAlpha  = Alpha.Transparent;
            band0.Columns[2].CellAppearance.TextHAlign             = Infragistics.Win.HAlign.Right;
            band0.Override.AllowAddNew = Infragistics.Win.UltraWinGrid.AllowAddNew.No;
            band0.Override.AllowDelete = Infragistics.Win.DefaultableBoolean.False;
            band0.Override.AllowUpdate = Infragistics.Win.DefaultableBoolean.False;

            band0.Columns["時間"].CellActivation = Activation.NoEdit;
            band0.Columns["內容"].CellActivation = Activation.NoEdit;
            band0.Columns["人員"].CellActivation = Activation.NoEdit;
        }
Example #6
0
        public void ConfigureColumns(String NombrePanel, String Filtro)
        {
            String        ConsultaSQL  = String.Empty;
            String        Ordenamiento = String.Empty;
            UltraGridBand Band         = ugEntity.DisplayLayout.Bands[0];

            mPanel = (Soft.Configuracion.Entidades.Panel)HelperNHibernate.GetEntityByField("Panel", "Nombre", NombrePanel);
            foreach (ColumnaPanel Columna in mPanel.Columnas)
            {
                UltraGridColumn Column = Band.Columns.Add(Columna.CampoSQL);
                Column.CellActivation = Activation.NoEdit;
                Column.Header.Caption = Columna.Nombre;
                Column.Width          = Columna.Ancho;
                Column.Hidden         = !Columna.Visible;
                if (Columna.Indice)
                {
                    Ordenamiento = String.Format("ORDER BY {0}", Columna.CampoSQL);
                }
            }
            if (Filtro.Length > 0)
            {
                Filtro = String.Format(" WHERE {0} ", Filtro);
            }
            ConsultaSQL         = String.Format("SELECT * FROM {0} {1} {2}", mPanel.NombreVista, Filtro, Ordenamiento);
            ugEntity.DataSource = HelperNHibernate.GetDataSet(ConsultaSQL);
        }
Example #7
0
        private void MiscTemplatesGridView_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
        {
            try
            {
                F11018MiscReceiptData.ListMiscReceiptTemplateDataTable miscReceiptTemplateDataTable = new F11018MiscReceiptData.ListMiscReceiptTemplateDataTable();
                UltraGridBand currentBand = this.MiscTemplatesGridView.DisplayLayout.Bands[0];
                currentBand.Columns[miscReceiptTemplateDataTable.MiscTemplateIDColumn.ColumnName].Header.VisiblePosition = 0;
                currentBand.Columns[miscReceiptTemplateDataTable.TemplateNameColumn.ColumnName].Header.VisiblePosition   = 1;
                currentBand.Columns[miscReceiptTemplateDataTable.UserIDColumn.ColumnName].Header.VisiblePosition         = 2;
                currentBand.Columns[miscReceiptTemplateDataTable.UserNameColumn.ColumnName].Header.VisiblePosition       = 3;
                currentBand.Columns[miscReceiptTemplateDataTable.ReceivedFromColumn.ColumnName].Header.VisiblePosition   = 4;
                currentBand.Columns[miscReceiptTemplateDataTable.AmountColumn.ColumnName].Header.VisiblePosition         = 5;
                currentBand.Columns[miscReceiptTemplateDataTable.CodeColumn.ColumnName].Header.VisiblePosition           = 6;

                currentBand.Columns[miscReceiptTemplateDataTable.MiscTemplateIDColumn.ColumnName].Hidden = true;
                currentBand.Columns[miscReceiptTemplateDataTable.TemplateNameColumn.ColumnName].Hidden   = false;
                currentBand.Columns[miscReceiptTemplateDataTable.UserIDColumn.ColumnName].Hidden         = true;
                currentBand.Columns[miscReceiptTemplateDataTable.UserNameColumn.ColumnName].Hidden       = true;
                currentBand.Columns[miscReceiptTemplateDataTable.ReceivedFromColumn.ColumnName].Hidden   = false;
                currentBand.Columns[miscReceiptTemplateDataTable.AmountColumn.ColumnName].Hidden         = false;
                currentBand.Columns[miscReceiptTemplateDataTable.AmountColumn.ColumnName].Format         = "#,##0.00";
                currentBand.Columns[miscReceiptTemplateDataTable.CodeColumn.ColumnName].Hidden           = true;
                this.MiscTemplatesGridView.DisplayLayout.Override.AllowColSizing = AllowColSizing.None;
            }
            catch (Exception ex)
            {
            }
        }
        private void grdRelations_InitializeLayout(object sender, InitializeLayoutEventArgs e)
        {
            UltraGridBand band = e.Layout.Bands[0];

            band.Override.AllowUpdate = DefaultableBoolean.False;

            ComputerBrandParameters pmtComputerBrand = new ComputerBrandParameters();

            IList <ComputerBrand> cctvBrands = this.srvComputerBrand.GetListByParameters(pmtComputerBrand);

            WindowsFormsUtil.SetUltraGridValueList(e.Layout, cctvBrands,
                                                   band.Columns["ComputerBrandId"], "ComputerBrandId", "Name", "Seleccione");

            OperativeSystemParameters pmtOperativeSystem = new OperativeSystemParameters();

            IList <OperativeSystem> cctvOperativeSystems = this.srvOperativeSystem.GetListByParameters(pmtOperativeSystem);

            WindowsFormsUtil.SetUltraGridValueList(e.Layout, cctvOperativeSystems,
                                                   band.Columns["OperativeSystemId"], "OperativeSystemId", "Name", "Seleccione");;

            PersonalComputerTypeParameters pmtPersonalComputerType = new PersonalComputerTypeParameters();

            IList <PersonalComputerType> cctvTypes = this.srvPersonalComputerType.GetListByParameters(pmtPersonalComputerType);

            WindowsFormsUtil.SetUltraGridValueList(e.Layout, cctvTypes,
                                                   band.Columns["PersonalComputerTypeId"], "PersonalComputerTypeId", "Name", "Seleccione");
        }
Example #9
0
        private void regionsGrid_DemandLoad(object sender, RowEventArgs e)
        {
            string code = (string)e.Row.DataKey;

            if (code != null)
            {
                UltraGridBand band = regionsGrid.Bands[1];
                if (band.Columns.Count == 0)
                {
                    //          foreach (UltraGridColumn col in regionsGrid.Bands[0].Columns)
                    //            band.Columns.Add(new UltraGridColumn().CopyFrom(col));

                    band.Columns.Add(new UltraGridColumn());
                    band.Columns.Add(new UltraGridColumn());
                    band.Columns[0].HeaderText = "Code";
                    band.Columns[1].HeaderText = "Name";
                    band.Columns[1].Width      = Unit.Parse("300px");
                }

                HyperCatalog.Business.CountryList countries = rootRegion.SubRegions[code].Countries;
                foreach (string countryCode in countries)
                {
                    HyperCatalog.Business.Country country = countries[countryCode];
                    UltraGridRow newRow = new UltraGridRow(new object[] { country.Code, country.Name });
                    newRow.DataKey = countryCode;
                    e.Row.Rows.Add(newRow);
                }
            }
        }
Example #10
0
        /// <summary>
        /// Erstellt ein neues Fenster zur Darstellung von Unterschieden zwischen Zeilen
        /// </summary>
        /// <param name="values">die Werte, die als Zeilen verwendet werden soll</param>
        public FormDiff(IEnumerable values)
        {
            this.Font = SystemFonts.MessageBoxFont;
            InitializeComponent();

            this.customizedUltraGrid.DisplayLayout.MaxBandDepth = 1;
            this.customizedUltraGrid.DataSource = values;

            // Aussehen für die hervorgehobenen Zellen
            Infragistics.Win.Appearance appearance = this.customizedUltraGrid.DisplayLayout.Appearances.Add("Positive");
            appearance.BackColor = Color.Yellow;

            UltraGridBand ultraGridBand = this.customizedUltraGrid.DisplayLayout.Bands[0];

            for (int i = 0; i < this.customizedUltraGrid.Rows.Count - 1; i++)
            {
                UltraGridRow previousRow = this.customizedUltraGrid.Rows[i];
                UltraGridRow currentRow  = this.customizedUltraGrid.Rows[i + 1];

                // Unterschiede zwischen den Zellwerten aufeinander folgender Zeilen ermitteln und ggf. hervorheben
                foreach (UltraGridColumn ultraGridColumn in ultraGridBand.Columns)
                {
                    object previousCellValue = previousRow.GetCellValue(ultraGridColumn);
                    object currentCellValue  = currentRow.GetCellValue(ultraGridColumn);
                    if (!Object.Equals(currentCellValue, previousCellValue))
                    {
                        currentRow.Cells[ultraGridColumn].Appearance = appearance;
                    }
                }
            }
        }
Example #11
0
        private void grdPrincipal_InitializeLayout(object sender, InitializeLayoutEventArgs e)
        {
            UltraGridLayout layout = e.Layout;
            UltraGridBand   band   = layout.Bands[0];
            int             index  = 0;

            foreach (UltraGridColumn column in band.Columns.Cast <UltraGridColumn>()
                     .Where(x => x.Index >= 4 && int.TryParse(x.Header.Caption, out index)))
            {
                column.Header.Caption = this.lstLines
                                        .Single(x => x.ProductLineId == Convert.ToInt32(column.Header.Caption)).Name.Trim();

                column.Header.TextOrientation = new TextOrientationInfo(65, TextFlowDirection.Horizontal);

                column.PerformAutoResize();
            }

            foreach (UltraGridRow row in this.frmVerticalIntegration.grdPrincipal.Rows.Where(x => x.Cells != null))
            {
                foreach (UltraGridCell cell in row.Cells.Cast <UltraGridCell>().Where(x => x.Column.Index >= 4))
                {
                    if (!Convert.ToBoolean(cell.Value))
                    {
                        cell.Appearance.BackColor = Color.Yellow;
                    }
                }
            }

            band.Columns["CustomerId"].Header.Caption    = "Id Cliente";
            band.Columns["Agent"].Header.Caption         = "Agente";
            band.Columns["CustomerName"].Header.Caption  = "Nombre Cliente";
            band.Columns["ComercialName"].Header.Caption = "Nombre Comercial";

            band.SortedColumns.Add("Agent", false, true);
        }
Example #12
0
        /// <summary>
        /// Perform general configuration of the grid to match the report being displayed
        /// </summary>
        /// <param name="grid"></param>
        public void InitializeGrid(UltraGrid grid)
        {
            grid.Tag = this;
            try
            {
                UltraGridBand applicationsBand = grid.DisplayLayout.Bands[0];
                applicationsBand.Columns["applicationid"].Hidden           = true;
                applicationsBand.Columns["object"].Hidden                  = true;
                applicationsBand.Columns["publisher"].CellAppearance.Image = Properties.Resources.application_16;
                //
                UltraGridBand instancesBand = grid.DisplayLayout.Bands[1];
                instancesBand.Columns["instanceid"].Hidden               = true;
                instancesBand.Columns["applicationid"].Hidden            = true;
                instancesBand.Columns["object"].Hidden                   = true;
                instancesBand.Columns["Asset Name"].CellAppearance.Image = Properties.Resources.computer16;
                //
                UltraGridBand licensesBand = grid.DisplayLayout.Bands[2];
                licensesBand.Columns["licenseid"].Hidden     = true;
                licensesBand.Columns["applicationid"].Hidden = true;
                licensesBand.Columns["object"].Hidden        = true;
                licensesBand.Columns["License Type"].CellAppearance.Image = Properties.Resources.application_license_16;

                // But hide any bands that we have requested not too show
                instancesBand.Hidden = !_showInstanceDetails;
                licensesBand.Hidden  = !_showLicenses;
            }
            catch (Exception ex)
            {
                MessageBox.Show("An exception has occurred while initializing the grid for the Licensing Report.  The error was : " + ex.Message, "Exception Error");
            }
        }
Example #13
0
        private void _grid_Servers_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
        {
            UltraGridBand band = e.Layout.Bands[0];

            band.Columns[colSeverity].Header.Caption             = string.Empty;
            band.Columns[colSeverity].CellAppearance.ImageHAlign = Infragistics.Win.HAlign.Center;
            band.Columns[colSeverity].Width = 20;
            EditorWithText textEditor = new EditorWithText();

            band.Columns[colSeverity].Editor = textEditor;
            band.Columns[colSeverity].Hidden = true;

            band.Columns[colServer].Width = 160;

            band.Columns[colHigh].Header.Caption                = string.Empty;
            band.Columns[colHigh].Header.Appearance.Image       = global::Idera.SQLsecure.UI.Console.Properties.Resources.HighRisk_16;
            band.Columns[colHigh].Header.Appearance.ImageHAlign = HAlign.Center;
            band.Columns[colHigh].CellAppearance.TextHAlign     = HAlign.Right;
            band.Columns[colHigh].Width = 24;

            band.Columns[colMedium].Header.Caption                = string.Empty;
            band.Columns[colMedium].Header.Appearance.Image       = global::Idera.SQLsecure.UI.Console.Properties.Resources.MediumRisk_16;
            band.Columns[colMedium].Header.Appearance.ImageHAlign = HAlign.Center;
            band.Columns[colMedium].CellAppearance.TextHAlign     = HAlign.Right;
            band.Columns[colMedium].Width = 24;

            band.Columns[colLow].Header.Caption                = string.Empty;
            band.Columns[colLow].Header.Appearance.Image       = global::Idera.SQLsecure.UI.Console.Properties.Resources.LowRisk_16;
            band.Columns[colLow].Header.Appearance.ImageHAlign = HAlign.Center;
            band.Columns[colLow].CellAppearance.TextHAlign     = HAlign.Right;
            band.Columns[colLow].Width = 24;

            band.Columns[colStatus].Header.Caption = "Findings";
            band.Columns[colStatus].Hidden         = true;
        }
        private void grdRelations_InitializeLayout(object sender, InitializeLayoutEventArgs e)
        {
            UltraGridBand band = e.Layout.Bands[0];

            band.Override.AllowUpdate = DefaultableBoolean.False;

            ComputerBrandParameters pmtComputerBrand = new ComputerBrandParameters();

            IList <ComputerBrand> cctvBrands = this.srvComputerBrand.GetListByParameters(pmtComputerBrand);

            WindowsFormsUtil.SetUltraGridValueList(e.Layout, cctvBrands,
                                                   band.Columns["ComputerBrandId"], "ComputerBrandId", "Name", "Seleccione");

            OperativeSystemParameters pmtOperativeSystem = new OperativeSystemParameters()
            {
                OperativeSystemTypeId = ParameterConstants.IntDefault
            };

            IList <OperativeSystem> cctvTypes = this.srvOperativeSystem.GetListByParameters(pmtOperativeSystem);

            this.controlCustomerInfrastructureServerComputers.oscOperativeSystem.Parameters = pmtOperativeSystem;
            this.controlCustomerInfrastructureServerComputers.oscOperativeSystem.Refresh();

            WindowsFormsUtil.SetUltraGridValueList(e.Layout, cctvTypes,
                                                   band.Columns["OperativeSystemId"], "OperativeSystemId", "Name", "Seleccione");
        }
Example #15
0
        private void btnConsultar_Click(object sender, EventArgs e)
        {
            try
            {
                dgvDatos.DataSource = null;
                using (SqlConnection connection = new SqlConnection(Datos.Clases.Constantes.conectionLog))
                {
                    using (SqlCommand command = new SqlCommand("sp_ListaPrecios", connection))
                    {
                        command.CommandType = CommandType.StoredProcedure;

                        command.Parameters.AddWithValue("@TipoConsulta", 1);
                        command.Parameters.AddWithValue("@ItmsGrpCod", cbLinea.SelectedValue);
                        command.Parameters.AddWithValue("@ItemCode", txtArticulo.Text);

                        SqlDataAdapter da = new SqlDataAdapter();
                        da.SelectCommand = command;

                        DataTable table = new DataTable();
                        da.Fill(table);

                        dgvDatos.DataSource = table;
                    }
                }
                button1.Text = "Filtrar errores";
                UltraGridBand band = this.dgvDatos.DisplayLayout.Bands[0];
                band.ColumnFilters["Error"].FilterConditions.Clear();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.Message, "HalcoNET", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #16
0
        private void grdRelations_InitializeLayout(object sender, InitializeLayoutEventArgs e)
        {
            UltraGridBand band = e.Layout.Bands[0];

            band.Override.AllowUpdate = DefaultableBoolean.False;

            BackupSoftwareBrandParameters pmtBackupSoftwareBrand = new BackupSoftwareBrandParameters();

            IList <BackupSoftwareBrand> cctvBrands = this.srvBackupSoftwareBrand.GetListByParameters(pmtBackupSoftwareBrand);

            WindowsFormsUtil.SetUltraGridValueList(e.Layout, cctvBrands,
                                                   band.Columns["BackupSoftwareBrandId"], "BackupSoftwareBrandId", "Name", "Seleccione");

            if (this.CustomerInfrastructure != null)
            {
                CustomerInfrastructureServerComputerParameters pmtCustomerInfrastructureServerComputer
                    = new CustomerInfrastructureServerComputerParameters();

                pmtCustomerInfrastructureServerComputer.CustomerInfrastructureId = this.CustomerInfrastructure.CustomerInfrastructureId;
                IList <CustomerInfrastructureServerComputer> customerInfrastructureServerComputers
                    = this.srvCustomerInfrastructureServerComputer.GetListByParameters(pmtCustomerInfrastructureServerComputer);

                this.controlCustomerInfrastructureBackupSoftwares.cisccCustomerInfrastructureServerComputer.Parameters
                    = pmtCustomerInfrastructureServerComputer;
                this.controlCustomerInfrastructureBackupSoftwares.cisccCustomerInfrastructureServerComputer.DisplayMember
                    = "ServerModel";
                this.controlCustomerInfrastructureBackupSoftwares.cisccCustomerInfrastructureServerComputer.Refresh();

                WindowsFormsUtil.SetUltraGridValueList(e.Layout, customerInfrastructureServerComputers,
                                                       band.Columns["CustomerInfrastructureServerComputerId"], "CustomerInfrastructureServerComputerId",
                                                       "ServerModel", "Seleccione");
            }
        }
Example #17
0
        private void InitializeComponent()
        {
            this.userControlDataGridBENEFICIRANI = new BENEFICIRANIDataGrid();
            ((ISupportInitialize)this.userControlDataGridBENEFICIRANI).BeginInit();
            UltraGridBand   band    = new UltraGridBand("BENEFICIRANI", -1);
            UltraGridColumn column2 = new UltraGridColumn("IDBENEFICIRANI");
            UltraGridColumn column3 = new UltraGridColumn("NAZIVBENEFICIRANI");
            UltraGridColumn column  = new UltraGridColumn("BROJPRIZNATIHMJESECI");

            this.SuspendLayout();
            Infragistics.Win.Appearance appearance2 = new Infragistics.Win.Appearance();
            column2.CellActivation     = Activation.NoEdit;
            column2.ButtonDisplayStyle = Infragistics.Win.UltraWinGrid.ButtonDisplayStyle.OnCellActivate;
            column2.Header.Caption     = StringResources.BENEFICIRANIIDBENEFICIRANIDescription;
            column2.Width          = 240;
            column2.Format         = "";
            column2.CellAppearance = appearance2;
            Infragistics.Win.Appearance appearance3 = new Infragistics.Win.Appearance();
            column3.CellActivation     = Activation.NoEdit;
            column3.ButtonDisplayStyle = Infragistics.Win.UltraWinGrid.ButtonDisplayStyle.OnCellActivate;
            column3.Header.Caption     = StringResources.BENEFICIRANINAZIVBENEFICIRANIDescription;
            column3.Width          = 0x128;
            column3.Format         = "";
            column3.CellAppearance = appearance3;
            Infragistics.Win.Appearance appearance = new Infragistics.Win.Appearance();
            column.CellActivation     = Activation.NoEdit;
            column.ButtonDisplayStyle = Infragistics.Win.UltraWinGrid.ButtonDisplayStyle.OnCellActivate;
            column.Header.Caption     = StringResources.BENEFICIRANIBROJPRIZNATIHMJESECIDescription;
            column.Width          = 0x120;
            appearance.TextHAlign = HAlign.Right;
            column.MaskInput      = "{LOC}-nn";
            column.PromptChar     = ' ';
            column.Format         = "";
            column.CellAppearance = appearance;
            band.Columns.Add(column2);
            column2.Header.VisiblePosition = 0;
            band.Columns.Add(column3);
            column3.Header.VisiblePosition = 1;
            band.Columns.Add(column);
            column.Header.VisiblePosition = 2;
            this.userControlDataGridBENEFICIRANI.Visible = true;
            System.Drawing.Point point = new System.Drawing.Point(0, 0);
            this.userControlDataGridBENEFICIRANI.Location = point;
            this.userControlDataGridBENEFICIRANI.Name     = "userControlDataGridBENEFICIRANI";
            this.userControlDataGridBENEFICIRANI.Tag      = "BENEFICIRANI";
            this.userControlDataGridBENEFICIRANI.Size     = new System.Drawing.Size(0x200, 0x144);
            this.userControlDataGridBENEFICIRANI.DisplayLayout.BorderStyle = UIElementBorderStyle.None;
            this.userControlDataGridBENEFICIRANI.Dock          = DockStyle.Fill;
            this.userControlDataGridBENEFICIRANI.FillAtStartup = false;
            this.userControlDataGridBENEFICIRANI.DisplayLayout.Appearance.TextHAlign = HAlign.Left;
            this.userControlDataGridBENEFICIRANI.InitializeRow += new InitializeRowEventHandler(this.BENEFICIRANIUserDataGrid_InitializeRow);
            this.userControlDataGridBENEFICIRANI.DisplayLayout.BandsSerializer.Add(band);
            this.Controls.AddRange(new Control[] { this.userControlDataGridBENEFICIRANI });
            this.Name  = "BENEFICIRANIUserDataGrid";
            this.Size  = new System.Drawing.Size(0x200, 0x144);
            this.Load += new EventHandler(this.BENEFICIRANIUserDataGrid_Load);
            ((ISupportInitialize)this.userControlDataGridBENEFICIRANI).EndInit();
            this.ResumeLayout(false);
        }
        private void grdPrincipal_InitializeLayout(object sender, InitializeLayoutEventArgs e)
        {
            UltraGridLayout layout = e.Layout;
            UltraGridBand   band   = layout.Bands[0];

            WindowsFormsUtil.SetUltraGridValueList(layout, TimeUtil.Months,
                                                   band.Columns["Month"], "Index", "Name", null);
        }
Example #19
0
        private void grdPrincipal_InitializeLayout(object sender, InitializeLayoutEventArgs e)
        {
            UltraGridLayout layout = e.Layout;
            UltraGridBand   band   = layout.Bands[0];

            WindowsFormsUtil.SetUltraGridValueList(layout, this.srvGeneric.GetListByParameters <BusinessType>(null),
                                                   band.Columns["BusinessTypeId"], "BusinessTypeId", "Name", "Seleccione");
        }
Example #20
0
        /// <summary>
        /// Handles the InitializeLayout event of the gridInventory control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs"/> instance containing the event data.</param>
        private void gridInventory_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
        {
            UltraGridLayout layout = e.Layout;

            layout.AutoFitStyle             = AutoFitStyle.ResizeAllColumns;
            layout.Override.CellClickAction = CellClickAction.RowSelect;
            layout.LoadStyle             = LoadStyle.LoadOnDemand;
            layout.Override.RowSelectors = Infragistics.Win.DefaultableBoolean.False;
            layout.Override.RowSizing    = RowSizing.Fixed;
            layout.Override.CellAppearance.TextHAlign = Infragistics.Win.HAlign.Center;
            layout.Override.CellAppearance.TextVAlign = Infragistics.Win.VAlign.Middle;
            layout.Override.HeaderClickAction         = HeaderClickAction.SortMulti;
            layout.Override.CellSpacing = 3;
            UltraGridBand band = layout.Bands[0];

            if (band.Key == "Deliveries")
            {
                band.Columns["EndDateTime"].Hidden         = true;
                band.Columns["AllDayEvent"].Hidden         = true;
                band.Columns["Category"].Hidden            = true;
                band.Columns["DataKey"].Header.Caption     = Properties.Resources.PartNumber;
                band.Columns["Weight"].Header.Caption      = Properties.Resources.TotalWeightLbs;
                band.Columns["Cost"].Header.Caption        = Properties.Resources.TotalDue;
                band.Columns["Subject"].Header.Caption     = Properties.Resources.Subject;
                band.Columns["Description"].Header.Caption = Properties.Resources.Description;
                band.Columns["Count"].Header.Caption       = Properties.Resources.Count;

                UltraGridColumn column = band.Columns["StartDateTime"];
                column.Header.Caption = Properties.Resources.DeliveryDate;
                column.Style          = Infragistics.Win.UltraWinGrid.ColumnStyle.DateWithoutDropDown;
                band.SortedColumns.Add(column, false);
            }
            else
            {
                UltraGridColumn column = band.Columns["WeightPerItem"];
                column.Header.Caption = Properties.Resources.WeightLbs;
                column.Format         = "F1";

                column = band.Columns["PricePerItem"];
                column.Header.Caption = Properties.Resources.PricePerItem;
                column.Format         = "C";

                band.Columns["PartNumber"].Header.Caption   = Properties.Resources.PartNumber;
                band.Columns["InStock"].Header.Caption      = Properties.Resources.InStock;
                band.Columns["Manufacturer"].Header.Caption = Properties.Resources.Manufacturer;
                band.Columns["Component"].Header.Caption    = Properties.Resources.Component;

                // Add a column for the Orders ("Order Part", "View Shipment") button
                if (band.Columns.IndexOf("Orders") == -1)
                {
                    UltraGridColumn deliveries = band.Columns.Add("Orders");
                    deliveries.Header.Caption     = Properties.Resources.Availability;
                    deliveries.DataType           = typeof(string);
                    deliveries.Style              = Infragistics.Win.UltraWinGrid.ColumnStyle.Button;
                    deliveries.ButtonDisplayStyle = ButtonDisplayStyle.Always;
                }
            }
        }
Example #21
0
        private void ChangeDataGridStyle(bool add)
        {
            IEnumerator enumerator = null;

            try
            {
                enumerator = this.DataGrids.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    UltraGrid        current     = (UltraGrid)enumerator.Current;
                    UltraGridBand    band        = current.DisplayLayout.Bands[0];
                    ColumnEnumerator enumerator2 = band.Columns.GetEnumerator();
                    while (enumerator2.MoveNext())
                    {
                        IEnumerator     enumerator3 = null;
                        UltraGridColumn column      = enumerator2.Current;
                        string          key         = column.Key;
                        bool            flag        = false;
                        try
                        {
                            enumerator3 = new AttributeAllKeysEnumeratorCollection(this.formDataSet.Tables).GetEnumerator();
                            while (enumerator3.MoveNext())
                            {
                                if (Conversions.ToString(enumerator3.Current) == key)
                                {
                                    flag = true;
                                }
                            }
                        }
                        finally
                        {
                            if (enumerator3 is IDisposable)
                            {
                                (enumerator3 as IDisposable).Dispose();
                            }
                        }
                        if (flag)
                        {
                            if (add)
                            {
                                column.CellActivation = Activation.AllowEdit;
                            }
                            else
                            {
                                column.CellActivation = Activation.ActivateOnly;
                            }
                        }
                    }
                }
            }
            finally
            {
                if (enumerator is IDisposable)
                {
                    (enumerator as IDisposable).Dispose();
                }
            }
        }
        private void AdicionaImagenesGrilla()
        {
            UltraGridBand band = this.Grd_mvto_Mayor_FuenteFinanciamiento.DisplayLayout.Bands[0];

            foreach (UltraGridRow row in band.GetRowEnumerator(GridRowType.DataRow))
            {
                RefrescarCeldaGrilla(row);
            }
        }
Example #23
0
        /// <summary>
        /// Filters the grid based on tool.
        /// </summary>
        /// <param name="tool">The tool.</param>
        private void FilterGridBasedOnTool(RadialMenuTool tool)
        {
            string       key = tool.Key;
            CategoryType category;

            try
            {
                // get the CategoryType from the Tag
                if (tool.Tag is CategoryType)
                {
                    category = (CategoryType)tool.Tag;

                    // if the currentGridData is still the defualt data, bind the Inventory data to the grid
                    if (this.currentGridData == MainForm.DefaultGridData)
                    {
                        this.gridInventory.DataSource = AutoPartsCatalog.Instance.InventoryTable;
                        this.currentGridData          = UI.Inventory;
                    }

                    // apply a filter to the Category column based on the CategoryType
                    UltraGridBand band   = this.gridInventory.DisplayLayout.Bands["Inventory"];
                    ColumnFilter  filter = band.ColumnFilters["Category"];
                    if (filter.FilterConditions.Count > 0)
                    {
                        filter.FilterConditions[0].CompareValue = (int)category;
                    }
                    else
                    {
                        filter.FilterConditions.Add(FilterComparisionOperator.Equals, (int)category);
                    }

                    // add secondary filter to the Components column
                    filter = band.ColumnFilters["Component"];
                    if (string.IsNullOrEmpty(key) == false)
                    {
                        if (filter.FilterConditions.Count > 0)
                        {
                            filter.FilterConditions[0].CompareValue = key;
                        }
                        else
                        {
                            filter.FilterConditions.Add(FilterComparisionOperator.Equals, key);
                        }
                    }
                    else
                    {
                        filter.ClearFilterConditions();
                    }

                    this.ChangeHeader(category, key);
                }
            }
            finally
            {
                this.gridInventory.DisplayLayout.PerformAutoResizeColumns(false, PerformAutoSizeType.VisibleRows);
            }
        }
Example #24
0
        private void grdRegionOption_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
        {
            UltraGridLayout layout      = e.Layout;
            UltraGridBand   band        = layout.Bands[0];
            UltraGridColumn imageColumn = band.Columns.Add("Delete");

            imageColumn.DataType = typeof(Image);
            imageColumn.Style    = Infragistics.Win.UltraWinGrid.ColumnStyle.Image;
        }
        private void AdicionaImagenesGrilla()
        {
            UltraGridBand band = this.Grd_Buscados.DisplayLayout.Bands[0];

            foreach (UltraGridRow row in band.GetRowEnumerator(GridRowType.DataRow))
            {
                RefrescarCeldaGrilla(row);
            }
        }
Example #26
0
        public void Sumar(decimal pros, decimal pros85)
        {
            UltraGridBand band = this.UltraGrid1.DisplayLayout.Bands[0];

            band.Summaries.Clear();


            SummarySettings settings = band.Summaries.Add("Ukupnobruto", SummaryType.Custom, new OrderTotalsSummary(), band.Columns["iznosbruto"], SummaryPosition.UseSummaryPositionColumn, band.Columns["iznosbruto"]);

            settings.DisplayFormat            = "{0:N2}";
            settings.Appearance.TextHAlign    = HAlign.Right;
            settings.SummaryPosition          = SummaryPosition.UseSummaryPositionColumn;
            settings.Appearance.FontData.Bold = DefaultableBoolean.True;
            settings.Appearance.ForeColor     = Color.Black;
            settings.Appearance.BackColor     = Color.WhiteSmoke;
            band.SummaryFooterCaption         = "Prosjek";


            SummarySettings settings2 = band.Summaries.Add("satiukupno", SummaryType.Custom, new SatiUkupnoSumar(), band.Columns["satiukupno"], SummaryPosition.UseSummaryPositionColumn, band.Columns["satiukupno"]);

            settings2.DisplayFormat            = "{0:N2}";
            settings2.Appearance.TextHAlign    = HAlign.Right;
            settings2.SummaryPosition          = SummaryPosition.UseSummaryPositionColumn;
            settings2.Appearance.FontData.Bold = DefaultableBoolean.True;
            settings2.Appearance.ForeColor     = Color.Black;
            settings2.Appearance.BackColor     = Color.WhiteSmoke;


            SummarySettings settings3 = band.Summaries.Add("PROSJECNASATNICA", SummaryType.Custom, new pROSJEKsATI(), band.Columns["PROSJECNASATNICA"], SummaryPosition.UseSummaryPositionColumn, band.Columns["PROSJECNASATNICA"]);

            settings3.DisplayFormat            = "{0:N2}";
            settings3.Appearance.TextHAlign    = HAlign.Right;
            settings3.SummaryPosition          = SummaryPosition.UseSummaryPositionColumn;
            settings3.Appearance.FontData.Bold = DefaultableBoolean.True;
            settings3.Appearance.ForeColor     = Color.Black;
            settings3.Appearance.BackColor     = Color.WhiteSmoke;


            SummarySettings settings4 = band.Summaries.Add("PROSJECNASATNICA_85POSTO", SummaryType.Custom, new pROSJEKsATI85(), band.Columns["PROSJECNASATNICA_85POSTO"], SummaryPosition.UseSummaryPositionColumn, band.Columns["PROSJECNASATNICA_85POSTO"]);

            settings4.DisplayFormat            = "{0:N2}";
            settings4.Appearance.TextHAlign    = HAlign.Right;
            settings4.SummaryPosition          = SummaryPosition.UseSummaryPositionColumn;
            settings4.Appearance.FontData.Bold = DefaultableBoolean.True;
            settings4.Appearance.ForeColor     = Color.Black;
            settings4.Appearance.BackColor     = Color.WhiteSmoke;



            this.UltraGrid1.DisplayLayout.Override.SummaryFooterAppearance.FontData.Bold    = DefaultableBoolean.True;
            this.UltraGrid1.DisplayLayout.Override.SummaryFooterAppearance.BackColor        = Color.White;
            this.UltraGrid1.DisplayLayout.Override.SummaryFooterAppearance.ForeColor        = Color.Black;
            this.UltraGrid1.DisplayLayout.Override.SummaryFooterCaptionVisible              = DefaultableBoolean.True;
            this.UltraGrid1.DisplayLayout.Override.SummaryFooterCaptionAppearance.BackColor = Color.Red;
            this.UltraGrid1.DisplayLayout.Override.SummaryFooterCaptionAppearance.ForeColor = Color.White;
        }
        private void btnPagar_Click(object sender, EventArgs e)
        {
            UltraGridBand     band = this.grdData.DisplayLayout.Bands[1];
            HospitalizacionBL o    = new HospitalizacionBL();
            var listapagos         = new List <LiquidacionMedicoList>();

            List <LiquidacionServicios> _data = new List <LiquidacionServicios>();

            foreach (UltraGridRow row in band.GetRowEnumerator(GridRowType.DataRow))
            {
                if ((bool)row.Cells["Select"].Value)
                {
                    var oLiquidacionMedicoList = new LiquidacionServicios();

                    string serviceId = row.Cells["v_ServiceId"].Value.ToString();
                    o.ActualizarPagoMedico(serviceId);

                    oLiquidacionMedicoList.d_ServiceDate = DateTime.Parse(row.Cells["d_ServiceDate"].Value.ToString());
                    oLiquidacionMedicoList.Paciente      = row.Cells["Paciente"].Value.ToString();

                    oLiquidacionMedicoList.Tipo        = row.Cells["Tipo"].Value.ToString();
                    oLiquidacionMedicoList.Aseguradora = row.Cells["Aseguradora"].Value == null ? "" : row.Cells["Aseguradora"].Value.ToString();
                    oLiquidacionMedicoList.v_ServiceId = row.Cells["v_ServiceId"].Value.ToString();
                    oLiquidacionMedicoList.r_Comision  = decimal.Parse(row.Cells["r_Comision"].Value.ToString());

                    _data.Add(oLiquidacionMedicoList);
                }
            }


            btnFilter_Click(sender, e);

            using (new LoadingClass.PleaseWait(this.Location, "Generando..."))
            {
                this.Enabled = false;

                var             MedicalCenter      = new ServiceBL().GetInfoMedicalCenter();
                OperationResult objOperationResult = new OperationResult();

                DateTime?fechaInicio = dtpDateTimeStar.Value.Date;
                DateTime?fechaFin    = dptDateTimeEnd.Value.Date.AddDays(1);

                string fechaInicio_1 = fechaInicio.ToString().Split(' ')[0];
                string fechaFin_1    = fechaFin.ToString().Split(' ')[0];

                string ruta = Common.Utils.GetApplicationConfigValue("rutaPagoMedicos").ToString();

                string fecha  = DateTime.Now.ToString().Split('/')[0] + "-" + DateTime.Now.ToString().Split('/')[1] + "-" + DateTime.Now.ToString().Split('/')[2];
                string nombre = "Pago Medico - CSL";

                var medico_info = new ServiceBL().GetSystemUser(ref objOperationResult, int.Parse(ddlUsuario.SelectedValue.ToString()));

                PagoMedicoAsitencial.CreatePagoMedicoAsitencial(ruta + nombre + ".pdf", MedicalCenter, _data, fechaInicio_1, fechaFin_1, medico_info);
                this.Enabled = true;
            }
        }
Example #28
0
 public static void AddUltraGridSummary(UltraGridBand band, UltraGridColumn column)
 {
     try
     {
         band.Summaries.Add(column.Key + band.Key, SummaryType.Sum, column, SummaryPosition.UseSummaryPositionColumn);
         band.Summaries[column.Key + band.Key].DisplayFormat         = "{0:###,###,##0.00}";
         band.Summaries[column.Key + band.Key].Appearance.TextHAlign = HAlign.Right;
     }
     catch { }
 }
    private void GetSignersAndCCs(int quoteNum)
    {
        //Call query to return CCs and Signers, bind to grd data sources, refresh grids
        DataSet queryDS = SignerCC(quoteNum);

        try
        {
            /*BAQ = JRF-QuoteCnts_HelloSign
             * //BAQ Schema = Customer_Name; Customer_EMailAddress; Calculated_Function; Calculated_Signer
             * //dtSigners.Rows.Add(name, email, "ASC");
             */
            foreach (DataRow row in queryDS.Tables["Results"].Rows)
            {
                if ((int)row["Calculated_Signer"] == 1)
                {
                    //add "signers" to dtSigners (Surgeon and office staff)
                    if ((string)row["Calculated_Function"] == "Surgeon")
                    {
                        //transform surgeon name into presentable format, instead of Lastname, Firstname
                        string newName = GetNewName((string)row["Customer_Name"]);
                        dtSigners.Rows.Add(newName, (string)row["Customer_EMailAddress"], (string)row["Calculated_Function"]);
                    }
                    else
                    {
                        dtSigners.Rows.Add((string)row["Customer_Name"], (string)row["Customer_EMailAddress"], (string)row["Calculated_Function"]);
                    }
                }
                else
                if ((int)row["Calculated_Signer"] == 0)
                {
                    //add "Ccs" to dtCCs (reps)
                    dtCCs.Rows.Add((string)row["Customer_Name"], (string)row["Customer_EMailAddress"], (string)row["Calculated_Function"]);
                }
            }
            /*Set up grid bindings*/
            this.grdSigners.DataSource = dtSigners;
            this.grdCCs.DataSource     = dtCCs;
            /*mark the "Surgeon" as primary*/
            foreach (var item in grdSigners.Rows)
            {
                if ((string)item.Cells["Function"].Value == "Surgeon")
                {
                    item.Cells["Primary"].Value = true;
                    item.CancelUpdate();
                }
            }
            /*re-sort grdSigners by primary*/
            UltraGridBand band = this.grdSigners.DisplayLayout.Bands[0];
            band.Columns["Primary"].SortIndicator = SortIndicator.Descending;
        }
        catch (Exception ex)
        {
            MessageBox.Show("Oops! Something went wrong: " + ex.Message);
        }
    }
Example #30
0
        private void InitializeComponent()
        {
            this.userControlDataGridS_OD_OO_MJESECNO = new S_OD_OO_MJESECNODataGrid();
            ((ISupportInitialize)this.userControlDataGridS_OD_OO_MJESECNO).BeginInit();
            UltraGridBand   band    = new UltraGridBand("S_OD_OO_MJESECNO", -1);
            UltraGridColumn column  = new UltraGridColumn("IDRADNIK");
            UltraGridColumn column2 = new UltraGridColumn("UKUPNOOBRACUNATOOO");

            this.SuspendLayout();
            Infragistics.Win.Appearance appearance = new Infragistics.Win.Appearance();
            column.CellActivation     = Activation.NoEdit;
            column.ButtonDisplayStyle = Infragistics.Win.UltraWinGrid.ButtonDisplayStyle.OnCellActivate;
            column.Header.Caption     = StringResources.S_OD_OO_MJESECNOIDRADNIKDescription;
            column.Width          = 0x69;
            appearance.TextHAlign = HAlign.Right;
            column.MaskInput      = "{LOC}-nnnnnnnn";
            column.PromptChar     = ' ';
            column.Format         = "";
            column.CellAppearance = appearance;
            Infragistics.Win.Appearance appearance2 = new Infragistics.Win.Appearance();
            column2.CellActivation     = Activation.NoEdit;
            column2.ButtonDisplayStyle = Infragistics.Win.UltraWinGrid.ButtonDisplayStyle.OnCellActivate;
            column2.Header.Caption     = StringResources.S_OD_OO_MJESECNOUKUPNOOBRACUNATOOODescription;
            column2.Width          = 0x8f;
            appearance2.TextHAlign = HAlign.Right;
            column2.MaskInput      = "{LOC}-nnnnnnnnnn.nn";
            column2.PromptChar     = ' ';
            column2.Format         = "F2";
            column2.CellAppearance = appearance2;
            band.Columns.Add(column);
            column.Header.VisiblePosition = 0;
            band.Columns.Add(column2);
            column2.Header.VisiblePosition = 1;
            this.userControlDataGridS_OD_OO_MJESECNO.Visible = true;
            System.Drawing.Point point = new System.Drawing.Point(0, 0);
            this.userControlDataGridS_OD_OO_MJESECNO.Location = point;
            this.userControlDataGridS_OD_OO_MJESECNO.Name     = "userControlDataGridS_OD_OO_MJESECNO";
            this.userControlDataGridS_OD_OO_MJESECNO.Tag      = "S_OD_OO_MJESECNO";
            Size size = new System.Drawing.Size(0x200, 0x144);

            this.userControlDataGridS_OD_OO_MJESECNO.Size = size;
            this.userControlDataGridS_OD_OO_MJESECNO.DisplayLayout.BorderStyle = UIElementBorderStyle.None;
            this.userControlDataGridS_OD_OO_MJESECNO.Dock          = DockStyle.Fill;
            this.userControlDataGridS_OD_OO_MJESECNO.FillAtStartup = false;
            this.userControlDataGridS_OD_OO_MJESECNO.DisplayLayout.Appearance.TextHAlign = HAlign.Left;
            this.userControlDataGridS_OD_OO_MJESECNO.InitializeRow += new InitializeRowEventHandler(this.S_OD_OO_MJESECNOUserDataGrid_InitializeRow);
            this.userControlDataGridS_OD_OO_MJESECNO.DisplayLayout.BandsSerializer.Add(band);
            this.Controls.AddRange(new Control[] { this.userControlDataGridS_OD_OO_MJESECNO });
            this.Name  = "S_OD_OO_MJESECNOUserDataGrid";
            size       = new System.Drawing.Size(0x200, 0x144);
            this.Size  = size;
            this.Load += new EventHandler(this.S_OD_OO_MJESECNOUserDataGrid_Load);
            ((ISupportInitialize)this.userControlDataGridS_OD_OO_MJESECNO).EndInit();
            this.ResumeLayout(false);
        }
Example #31
0
 public static void CreateUltraGridColumns(Infragistics.Win.UltraWinGrid.UltraGrid grid, string[] cols)
 {
     UltraGridBand ultraGridBand = new UltraGridBand("", -1);
     List<UltraGridColumn> list = new List<UltraGridColumn>();
     int i = 0;
     foreach (string col in cols)
     {
         UltraGridColumn ultraGridColumn = new Infragistics.Win.UltraWinGrid.UltraGridColumn(col.ToUpper());
         ultraGridColumn.Header.VisiblePosition = i++;
         list.Add(ultraGridColumn);
     }
     ultraGridBand.Columns.AddRange(list.ToArray());
     grid.DisplayLayout.BandsSerializer.Add(ultraGridBand);
 }
        public void UltraWebGrid(UltraWebGrid tmpUltraWebGrid, string condition, string[] captionNames, string[] tableColumns)
        {
            //tmpUltraWebGrid.Clear();     //清空
            tmpUltraWebGrid.Bands[0].Columns.Clear();   //清空數據列
            UltraGridBand band = new UltraGridBand();
            band = tmpUltraWebGrid.Bands[0];

            //Head行
            UltraGridColumn tmpHeadColumn = new UltraGridColumn();
            UltraGridCell tmpCell = new UltraGridCell();

            band.Columns.Add(tmpHeadColumn);

            //數據行
            UltraGridColumn tmpColumn = new UltraGridColumn();

            // tmpColumn.Band.

            band.Columns.Add(tmpColumn);    //動態增加列
        }
Example #33
0
        public static void RetrieveSetGridFormat(UltraGrid ugrid, UltraGridBand ug, string sModule, string sEmplNo)
        {
            ugrid.EventManager.AllEventsEnabled = false;
            string ssql = string.Format(" select colfor_colname, colfor_colorder, colfor_colwidth from colformat where empl_no = '{0}' and colfor_code = '{1}' ", sEmplNo, sModule);

            ADOSys_PD_GridFormat InstGrid = new ADOSys_PD_GridFormat();
            List<Sys_PD_GridFormat> fList = new List<Sys_PD_GridFormat>();
            fList = InstGrid.GetListByWhere(string.Format(" and empl_no = '{0}' and colfor_code = '{1}' ", sEmplNo, sModule));
            foreach (Sys_PD_GridFormat f in fList)
            {
                string sCol = f.ColFor_ColName;
                if (ug.Columns.Exists(sCol))
                {
                    ug.Columns[sCol].Header.VisiblePosition = f.ColFor_ColOrder;
                    ug.Columns[sCol].Width = int.Parse(f.ColFor_ColWidth);
                }
            }
            ugrid.EventManager.AllEventsEnabled = true;
        }
Example #34
0
        public static void SaveGridFormat(UltraGridBand ug, string sModuleCode, string sEmplNo)
        {
            ADOSys_PD_GridFormat InstGrid = new ADOSys_PD_GridFormat();
            Sys_PD_GridFormat formater = new Sys_PD_GridFormat();

            InstGrid.DeleteFormatter(sModuleCode, sEmplNo);

            foreach (UltraGridColumn aCol in ug.Columns)
            {
                if (aCol.Hidden == true)
                { }
                else
                {
                    formater.ColFor_Code = sModuleCode;
                    formater.Empl_NO = sEmplNo;
                    formater.ColFor_ColName = aCol.Key;
                    formater.ColFor_ColOrder = aCol.Header.VisiblePosition;
                    formater.ColFor_ColWidth = aCol.Width.ToString();
                    InstGrid.Add(formater);
                }
            }
        }
 //Get first visibble column
 public static UltraGridColumn GetFirstVisibleGridColumnForBand(UltraGridBand band)
 {
     return band.Columns.Cast<UltraGridColumn>()
                .FirstOrDefault(col => !col.Header.Caption.Contains("__"));
 }