Esempio n. 1
0
        private void uG_DanhSach_InitializeLayout(object sender, InitializeLayoutEventArgs e)
        {
            try
            {
                var band = e.Layout.Bands[0];
                band.Columns["ID"].Hidden = true;
                band.Columns["STT"].CellAppearance.TextHAlign = HAlign.Center;
                band.Columns["STT"].CellActivation            = Activation.NoEdit;
                band.Columns["STT"].CellAppearance.BackColor  = Color.LightCyan;
                band.Columns["STT"].MaxWidth = 70;
                band.Override.HeaderAppearance.TextHAlign            = HAlign.Center;
                band.Override.HeaderAppearance.FontData.SizeInPoints = 10;
                band.Override.HeaderAppearance.FontData.Bold         = DefaultableBoolean.True;

                #region Caption

                band.Columns["TenKhoa"].Header.Caption = FormResource.txtTenkhoa;

                #endregion
            }
            catch (Exception ex)
            {
                Log2File.LogExceptionToFile(ex);
            }
        }
Esempio n. 2
0
        private void dgvAlmacenes_InitializeLayout(object sender, InitializeLayoutEventArgs e)
        {
            Infragistics.Win.UltraWinGrid.UltraGridLayout layout = e.Layout;
            Infragistics.Win.UltraWinGrid.UltraGridBand   band   = layout.Bands[0];

            band.Columns[1].Hidden = true;

            band.Columns[0].Width = 80;
            band.Columns[1].Width = 40;
            band.Columns[2].Width = 80;
            band.Columns[3].Width = 90;
            band.Columns[4].Width = 90;
            band.Columns[5].Width = 90;
            band.Columns[6].Width = 90;
            band.Columns[7].Width = 90;

            band.Columns[3].Format = "C2";
            band.Columns[4].Format = "N2";
            band.Columns[5].Format = "N0";
            band.Columns[6].Format = "N0";
            band.Columns[7].Format = "N0";

            band.Columns[3].CellAppearance.TextHAlign = HAlign.Right;
            band.Columns[4].CellAppearance.TextHAlign = HAlign.Right;
            band.Columns[5].CellAppearance.TextHAlign = HAlign.Right;
            band.Columns[6].CellAppearance.TextHAlign = HAlign.Right;
            band.Columns[7].CellAppearance.TextHAlign = HAlign.Right;

            foreach (var item in band.Columns)
            {
                item.CellActivation = Activation.NoEdit;
            }
        }
Esempio n. 3
0
        private void Grd_mvto_ClasAsignados_InitializeLayout(object sender, InitializeLayoutEventArgs e)
        {
            e.Layout.Override.FilterUIType = FilterUIType.FilterRow;

            FilterOperatorDropDownItems val = FilterOperatorDropDownItems.Contains;

            Grd_mvto_ClasAsignados.DisplayLayout.Override.FilterOperatorDropDownItems = val;

            FilterOperatorDefaultValue val1 = FilterOperatorDefaultValue.Contains;

            Grd_mvto_ClasAsignados.DisplayLayout.Override.FilterOperatorDefaultValue = val1;

            Grd_mvto_ClasAsignados.DisplayLayout.ScrollStyle = ScrollStyle.Immediate;
            Grd_mvto_ClasAsignados.DisplayLayout.Scrollbars  = Scrollbars.Both;
            Grd_mvto_ClasAsignados.DisplayLayout.ColumnScrollbarSmallChange = 100;
            Grd_mvto_ClasAsignados.DisplayLayout.UseScrollWindow            = UseScrollWindow.None;
            this.Grd_mvto_ClasAsignados.UseOsThemes = DefaultableBoolean.False;

            //e.Layout.Bands[0].Columns[0].CellAppearance.BackColor = Color.LightGray;
            //e.Layout.Bands[0].Columns[0].CellAppearance.ForeColor = Color.Blue;
            //e.Layout.Bands[0].Columns[0].CellButtonAppearance.BackColor = Color.LightGray;

            //e.Layout.Bands[0].Columns[1].CellAppearance.BackColor = Color.LightGray;
            //e.Layout.Bands[0].Columns[1].CellAppearance.ForeColor = Color.Blue;
            //e.Layout.Bands[0].Columns[1].CellButtonAppearance.BackColor = Color.LightGray;
        }
Esempio n. 4
0
        private void gridList_InitializeLayout(object sender, InitializeLayoutEventArgs e)
        {
            //Hide Column
            gridList.DisplayLayout.Bands[0].Columns["DistId"].Hidden = true;

            //Set Caption
            gridList.DisplayLayout.Bands[0].Columns["DistName"].Header.Caption      = "District Name";
            gridList.DisplayLayout.Bands[0].Columns["DistNameShort"].Header.Caption = "Short Name";

            //Set Width
            gridList.DisplayLayout.Bands[0].Columns["DistName"].Width      = 300;
            gridList.DisplayLayout.Bands[0].Columns["DistNameShort"].Width = 150;

            //Change alternate color
            gridList.DisplayLayout.Override.RowAlternateAppearance.BackColor = Color.Cyan;
            gridList.DisplayLayout.Override.RowAlternateAppearance.ForeColor = Color.DarkBlue;

            //Select Full Row when click on any cell
            e.Layout.Override.CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.RowSelect;

            //Selection Style Will Be Row Selector
            this.gridList.DisplayLayout.Override.RowSelectors = Infragistics.Win.DefaultableBoolean.True;

            //Stop Updating
            this.gridList.DisplayLayout.Override.AllowUpdate = DefaultableBoolean.False;

            //Hiding +/- Indicator
            this.gridList.DisplayLayout.Override.ExpansionIndicator = ShowExpansionIndicator.Never;

            //Hide Group Box Display
            e.Layout.GroupByBox.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");
        }
Esempio n. 6
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;
        }
Esempio n. 7
0
 private void dgvCodigosRuta_InitializeLayout(object sender, InitializeLayoutEventArgs e)
 {
     try
     {
         e.Layout.Bands[0].Columns["ID"].Hidden                  = true;
         e.Layout.Bands[0].Columns["Codigo"].Header.Caption      = "Codigo Ruta";
         e.Layout.Bands[0].Columns["Nombre"].Header.Caption      = "Descripcion";
         e.Layout.Bands[0].Columns["Abreviatura"].Header.Caption = "Descripcion";
         e.Layout.Bands[0].Columns["nFrecuencia"].Header.Caption = "No. Frecuencia";
         e.Layout.Bands[0].Columns["bDiario"].Hidden             = true;
         e.Layout.Bands[0].Columns["bSemanal"].Hidden            = true;
         e.Layout.Bands[0].Columns["bQuincenal"].Hidden          = true;
         e.Layout.Bands[0].Columns["bMensual"].Hidden            = true;
         e.Layout.Bands[0].Columns["sFrecuencia"].Header.Caption = "Frecuencia";
         e.Layout.Bands[0].Columns["nUserAlta"].Hidden           = true;
         e.Layout.Bands[0].Columns["dAlta"].Hidden               = true;
         e.Layout.Bands[0].Columns["nUserUpdate"].Hidden         = true;
         e.Layout.Bands[0].Columns["dUpdate"].Hidden             = true;
         e.Layout.Bands[0].Columns["bActivo"].Hidden             = true;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message.ToString());
     }
 }
        private void gridEmpStatus_InitializeLayout(object sender, InitializeLayoutEventArgs e)
        {
            //gridCriteria.DisplayLayout.Bands[0].Columns["CValue"].Hidden = true;
            //gridCriteria.DisplayLayout.Bands[0].Columns["SLNo"].Hidden = true;
            gridEmpStatus.DisplayLayout.Bands[0].Columns["EmpStatus"].Width          = 200;
            gridEmpStatus.DisplayLayout.Bands[0].Columns["EmpStatus"].Header.Caption = "Employee Status";

            //Change alternate color
            gridEmpStatus.DisplayLayout.Override.RowAlternateAppearance.BackColor = Color.Cyan;
            gridEmpStatus.DisplayLayout.Override.RowAlternateAppearance.ForeColor = Color.DarkBlue;

            //Select Full Row when click on any cell
            e.Layout.Override.CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.RowSelect;

            //Selection Style Will Be Row Selector
            gridEmpStatus.DisplayLayout.Override.RowSelectors = Infragistics.Win.DefaultableBoolean.True;

            //Stop Updating
            gridEmpStatus.DisplayLayout.Override.AllowUpdate = DefaultableBoolean.False;

            //Hiding +/- Indicator
            gridEmpStatus.DisplayLayout.Override.ExpansionIndicator = ShowExpansionIndicator.Never;

            //Hide Group Box Display
            e.Layout.GroupByBox.Hidden = true;

            //Use Filtering
            gridEmpStatus.DisplayLayout.Override.AllowRowFiltering = DefaultableBoolean.False;
        }
 private void uddBand_InitializeLayout(object sender, InitializeLayoutEventArgs e)
 {
     //uddBand.DisplayLayout.Bands[0].Columns["Band"].Hidden = true;
     uddBand.DisplayLayout.Bands[0].Columns["Grade"].Header.Caption = "Grade";
     uddBand.DisplayMember = "Grade";
     uddBand.ValueMember   = "Grade";
 }
Esempio n. 10
0
 private void uddShift_InitializeLayout(object sender, InitializeLayoutEventArgs e)
 {
     uddShift.DisplayLayout.Bands[0].Columns["ShiftId"].Hidden           = true;
     uddShift.DisplayLayout.Bands[0].Columns["ShiftDesc"].Header.Caption = "Shift Name";
     uddShift.DisplayMember = "ShiftDesc";
     uddShift.ValueMember   = "ShiftId";
 }
Esempio n. 11
0
 private void cboEmpType_InitializeLayout(object sender, InitializeLayoutEventArgs e)
 {
     cboEmpType.DisplayLayout.Bands[0].Columns["emptype"].Width          = cboEmpType.Width;
     cboEmpType.DisplayLayout.Bands[0].Columns["emptype"].Header.Caption = "Employee Type";
     //cboEmpType.DisplayMember = "emptype";
     //cboEmpType.ValueMember = "emptype";
 }
        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");
        }
Esempio n. 13
0
        private void cboSubSection_InitializeLayout(object sender, InitializeLayoutEventArgs e)
        {
            cboSubSection.DisplayLayout.Bands[0].Columns["SubSectName"].Width = cboSubSection.Width;

            cboSubSection.DisplayLayout.Bands[0].Columns["Subsectname"].Header.Caption = "Sub Section";
            cboSubSection.DisplayLayout.Bands[0].Columns["SubsectId"].Hidden           = true;
        }
Esempio n. 14
0
 private void cboEmp_InitializeLayout(object sender, InitializeLayoutEventArgs e)
 {
     cboEmp.DisplayLayout.Bands[0].Columns["EmpName"].Width          = cboBand.Width;
     cboEmp.DisplayLayout.Bands[0].Columns["EmpName"].Header.Caption = "Name";
     cboEmp.DisplayMember = "EmpName";
     cboEmp.ValueMember   = "EmpId";
 }
Esempio n. 15
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);
        }
Esempio n. 16
0
        private void gridInfo_InitializeLayout(object sender, InitializeLayoutEventArgs e)
        {
            try
            {
                //Hide Column
                //this.gridInfo.DisplayLayout.Bands[0].Columns["ComId"].Hidden = true;

                ////Set Caption
                //gridDetails.DisplayLayout.Bands[0].Columns["isChecked"].Width = 50; //Short Name
                //gridDetails.DisplayLayout.Bands[0].Columns[0].Header.Caption = "ID";

                this.gridInfo.DisplayLayout.Bands[0].Columns["isChecked"].Style =
                    Infragistics.Win.UltraWinGrid.ColumnStyle.CheckBox;

                //Change alternate color
                gridInfo.DisplayLayout.Override.RowAlternateAppearance.BackColor = Color.Cyan;
                gridInfo.DisplayLayout.Override.RowAlternateAppearance.ForeColor = Color.DarkBlue;

                //Hiding +/- Indicator
                gridInfo.DisplayLayout.Override.ExpansionIndicator = ShowExpansionIndicator.Never;

                //Hide Group Box Display
                e.Layout.GroupByBox.Hidden = true;

                //Use Filtering
                e.Layout.Override.FilterUIType = FilterUIType.FilterRow;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 17
0
 private void cboStatus_InitializeLayout(object sender, InitializeLayoutEventArgs e)
 {
     cboStatus.DisplayLayout.Bands[0].Columns["EmpStatus"].Width          = cboStatus.Width;
     cboStatus.DisplayLayout.Bands[0].Columns["EmpStatus"].Header.Caption = "Employee Status";
     cboStatus.DisplayMember = "EmpStatus";
     cboStatus.ValueMember   = "EmpStatus";
 }
        private void gridProssType_InitializeLayout(object sender, InitializeLayoutEventArgs e)
        {
            gridProssType.DisplayLayout.Bands[0].Columns["Month"].Hidden = true;
            gridProssType.DisplayLayout.Bands[0].Columns["year"].Hidden  = true;
            gridProssType.DisplayLayout.Bands[0].Columns["date"].Hidden  = true;

            gridProssType.DisplayLayout.Bands[0].Columns["ProssType"].Width          = 275;
            gridProssType.DisplayLayout.Bands[0].Columns["ProssType"].Header.Caption = "Process Type";

            //Change alternate color
            gridProssType.DisplayLayout.Override.RowAlternateAppearance.BackColor = Color.Cyan;
            gridProssType.DisplayLayout.Override.RowAlternateAppearance.ForeColor = Color.DarkBlue;

            //Select Full Row when click on any cell
            e.Layout.Override.CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.RowSelect;

            //Selection Style Will Be Row Selector
            gridProssType.DisplayLayout.Override.RowSelectors = Infragistics.Win.DefaultableBoolean.True;

            //Stop Updating
            gridProssType.DisplayLayout.Override.AllowUpdate = DefaultableBoolean.False;

            //Hiding +/- Indicator
            gridProssType.DisplayLayout.Override.ExpansionIndicator = ShowExpansionIndicator.Never;

            //Hide Group Box Display
            e.Layout.GroupByBox.Hidden = true;

            //Use Filtering
            //gridProssType.DisplayLayout.Override.AllowRowFiltering = DefaultableBoolean.False;
            e.Layout.Override.FilterUIType = FilterUIType.FilterRow;
        }
Esempio n. 19
0
 private void cboSex_InitializeLayout(object sender, InitializeLayoutEventArgs e)
 {
     cboSex.DisplayLayout.Bands[0].Columns["Sex"].Width          = cboSex.Width;
     cboSex.DisplayLayout.Bands[0].Columns["Sex"].Header.Caption = "Gender";
     cboSex.DisplayMember = "Sex";
     cboSex.ValueMember   = "Sex";
 }
Esempio n. 20
0
 private void cboRelegion_InitializeLayout(object sender, InitializeLayoutEventArgs e)
 {
     cboRelegion.DisplayLayout.Bands[0].Columns["Religion"].Width          = cboRelegion.Width;
     cboRelegion.DisplayLayout.Bands[0].Columns["Religion"].Header.Caption = "Religion";
     cboRelegion.DisplayMember = "Religion";
     cboRelegion.ValueMember   = "Religion";
 }
Esempio n. 21
0
 private void cboShiftCat_InitializeLayout(object sender, InitializeLayoutEventArgs e)
 {
     cboShiftCat.DisplayLayout.Bands[0].Columns["ShiftCat"].Width          = cboShiftCat.Width;
     cboShiftCat.DisplayLayout.Bands[0].Columns["ShiftCat"].Header.Caption = "Shift Catagory";
     cboShiftCat.DisplayMember = "ShiftCat";
     cboShiftCat.ValueMember   = "ShiftCat";
 }
Esempio n. 22
0
        private void cboStatus1_InitializeLayout(object sender, InitializeLayoutEventArgs e)
        {
            cboStatus1.DisplayLayout.Bands[0].Columns["varname"].Width          = cboStatus1.Width;
            cboStatus1.DisplayLayout.Bands[0].Columns["varname"].Header.Caption = "Status";

            cboStatus1.DisplayLayout.Bands[0].Columns["varid"].Hidden = true;
        }
        private void grdRelations_InitializeLayout(object sender, InitializeLayoutEventArgs e)
        {
            UltraGridBand band = e.Layout.Bands[0];

            band.Override.AllowUpdate = DefaultableBoolean.False;

            DBMSParameters pmtDBMS = new DBMSParameters();

            IList <DBMS> cctvBrands = this.srvDBMS.GetListByParameters(pmtDBMS);

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

            CustomerInfrastructureServerComputerParameters pmtCustomerInfrastructureServerComputer
                = new CustomerInfrastructureServerComputerParameters();

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

                this.controlCustomerInfrastructureAdministationSoftwares.cisccDetCustomerInfrastructureServerComputer.Parameters
                    = pmtCustomerInfrastructureServerComputer;
                this.controlCustomerInfrastructureAdministationSoftwares.cisccDetCustomerInfrastructureServerComputer.DisplayMember
                    = "ServerModel";
                this.controlCustomerInfrastructureAdministationSoftwares.cisccDetCustomerInfrastructureServerComputer.Refresh();

                WindowsFormsUtil.SetUltraGridValueList(e.Layout, customerInfrastructureServerComputers,
                                                       band.Columns["CustomerInfrastructureServerComputerId"], "CustomerInfrastructureServerComputerId", "ServerModel", "Seleccione");
            }
        }
Esempio n. 24
0
        private void gridAtt_InitializeLayout(object sender, InitializeLayoutEventArgs e)
        {
            gridAtt.DisplayLayout.Bands[0].Columns["dtPunchDate"].Header.Caption = "Punch Date";
            gridAtt.DisplayLayout.Bands[0].Columns["inTime"].Header.Caption      = "In Time";
            gridAtt.DisplayLayout.Bands[0].Columns["outTime"].Header.Caption     = "Out Time";
            gridAtt.DisplayLayout.Bands[0].Columns["Status"].Header.Caption      = "Sts";
            gridAtt.DisplayLayout.Bands[0].Columns["Remarks"].Header.Caption     = "Remarks";

            gridAtt.DisplayLayout.Bands[0].Columns["dtPunchDate"].Width = 70;
            gridAtt.DisplayLayout.Bands[0].Columns["inTime"].Width      = 70;
            gridAtt.DisplayLayout.Bands[0].Columns["outTime"].Width     = 70;
            gridAtt.DisplayLayout.Bands[0].Columns["Status"].Width      = 30;
            gridAtt.DisplayLayout.Bands[0].Columns["Remarks"].Width     = 100;


            //Change alternate color
            gridAtt.DisplayLayout.Override.RowAlternateAppearance.BackColor = Color.Cyan;
            gridAtt.DisplayLayout.Override.RowAlternateAppearance.ForeColor = Color.DarkBlue;

            //Select Full Row when click on any cell
            e.Layout.Override.CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.RowSelect;

            //Selection Style Will Be Row Selector
            gridAtt.DisplayLayout.Override.RowSelectors = Infragistics.Win.DefaultableBoolean.True;

            //Stop Updating
            gridAtt.DisplayLayout.Override.AllowUpdate = DefaultableBoolean.False;

            //Hiding +/- Indicator
            gridAtt.DisplayLayout.Override.ExpansionIndicator = ShowExpansionIndicator.Never;

            //Hide Group Box Display
            e.Layout.GroupByBox.Hidden = true;
        }
Esempio n. 25
0
 private void cboType_InitializeLayout(object sender, InitializeLayoutEventArgs e)
 {
     cboType.DisplayLayout.Bands[0].Columns["varName"].Width          = cboType.Width;
     cboType.DisplayLayout.Bands[0].Columns["varName"].Header.Caption = "Increment Type";
     cboType.DisplayMember = "varName";
     cboType.ValueMember   = "varName";
 }
Esempio n. 26
0
        /// <summary>
        /// Extra Initialization of the grid
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ultraGridUsers_InitializeLayout(object sender, InitializeLayoutEventArgs e)
        {
            // Other miscellaneous settings
            // --------------------------------------------------------------------------------
            // Set the scroll style to immediate so the rows get scrolled immediately
            // when the vertical scrollbar thumb is dragged.
            //
            e.Layout.ScrollStyle = ScrollStyle.Immediate;

            // ScrollBounds of ScrollToFill will prevent the user from scrolling the
            // grid further down once the last row becomes fully visible.
            //
            e.Layout.ScrollBounds = ScrollBounds.ScrollToFill;

            //-----------------------------------------------------------------------------------
            //
            //    General Settings
            e.Layout.Override.CardAreaAppearance.BackColor         = Color.Transparent;
            e.Layout.Override.CardCaptionAppearance.BackColorAlpha = Infragistics.Win.Alpha.UseAlphaLevel;
            e.Layout.Override.CardCaptionAppearance.AlphaLevel     = 192;
            e.Layout.Override.RowAppearance.BackColorAlpha         = Infragistics.Win.Alpha.Transparent;
            e.Layout.Override.CellAppearance.BackColorAlpha        = Infragistics.Win.Alpha.UseAlphaLevel;
            e.Layout.Override.CellAppearance.AlphaLevel            = 192;
            e.Layout.Override.HeaderAppearance.AlphaLevel          = 192;
            e.Layout.Override.HeaderAppearance.BackColorAlpha      = Infragistics.Win.Alpha.UseAlphaLevel;
            e.Layout.Override.CellClickAction = CellClickAction.RowSelect;
        }
Esempio n. 27
0
        private void gridEmp_InitializeLayout(object sender, InitializeLayoutEventArgs e)
        {
            gridEmp.DisplayLayout.Bands[0].Columns["EmpId"].Hidden           = true;
            gridEmp.DisplayLayout.Bands[0].Columns["EmpCode"].Width          = 115;
            gridEmp.DisplayLayout.Bands[0].Columns["EmpCode"].Header.Caption = "Employee Code";
            gridEmp.DisplayLayout.Bands[0].Columns["EmpName"].Width          = 220;
            gridEmp.DisplayLayout.Bands[0].Columns["EmpName"].Header.Caption = "Employee Name";

            //Change alternate color
            gridEmp.DisplayLayout.Override.RowAlternateAppearance.BackColor = Color.Cyan;
            gridEmp.DisplayLayout.Override.RowAlternateAppearance.ForeColor = Color.DarkBlue;


            //Select Full Row when click on any cell
            e.Layout.Override.CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.RowSelect;

            //Selection Style Will Be Row Selector
            this.gridEmp.DisplayLayout.Override.RowSelectors = Infragistics.Win.DefaultableBoolean.True;

            //Stop Updating
            this.gridEmp.DisplayLayout.Override.AllowUpdate = DefaultableBoolean.False;

            //Hiding +/- Indicator
            this.gridEmp.DisplayLayout.Override.ExpansionIndicator = ShowExpansionIndicator.Never;
            e.Layout.Override.FilterUIType = FilterUIType.FilterRow;
            //Hide Group Box Display
            e.Layout.GroupByBox.Hidden = true;
        }
Esempio n. 28
0
 private void cboGrade_InitializeLayout(object sender, InitializeLayoutEventArgs e)
 {
     cboGrade.DisplayLayout.Bands[0].Columns["Grade"].Width          = cboGrade.Width;
     cboGrade.DisplayLayout.Bands[0].Columns["Grade"].Header.Caption = "Grade";
     cboGrade.DisplayMember = "Grade";
     cboGrade.ValueMember   = "Grade";
 }
Esempio n. 29
0
        //private void cbSite_SelectedIndexChanged(object sender, EventArgs e)
        //{
        //    if (Initialized)
        //    {
        //        ComboBoxItem cbi = (ComboBoxItem)cbSite.SelectedItem;
        //        VWA4Common.GlobalSettings.CurrentSiteID = cbi.Value;
        //        VWA4Common.DBDetector.GetDBDetector().SiteID = cbi.Value;
        //        this.ultraGrid1.Rows.ColumnFilters["SiteID"].ClearFilterConditions();
        //        this.ultraGrid1.Rows.ColumnFilters["SiteID"].FilterConditions.Add(Infragistics.Win.UltraWinGrid.FilterComparisionOperator.Equals, VWA4Common.GlobalSettings.CurrentSiteID);
        //        ultraGrid1.Refresh();
        //    }

        //}

        private void ultraGrid1_InitializeLayout(object sender, InitializeLayoutEventArgs e)
        {
            if (this.ultraGrid1.Rows.ColumnFilters.Exists("SiteID"))
            {
                this.ultraGrid1.Rows.ColumnFilters["SiteID"].ClearFilterConditions();
            }

            this.ultraGrid1.Rows.ColumnFilters["SiteID"].FilterConditions.Add(Infragistics.Win.UltraWinGrid.FilterComparisionOperator.Equals, VWA4Common.GlobalSettings.CurrentSiteID);

            e.Layout.Bands[0].Columns["PeriodStartDate"].SortIndicator   = SortIndicator.Descending;
            e.Layout.Bands[0].Columns["FoodCostActual"].SortIndicator    = SortIndicator.None;
            e.Layout.Bands[0].Columns["FoodRevenueActual"].SortIndicator = SortIndicator.None;
            e.Layout.Bands[0].Columns["MealCountActual"].SortIndicator   = SortIndicator.None;
            e.Layout.Bands[0].Columns["FoodCostBudget"].SortIndicator    = SortIndicator.None;
            e.Layout.Bands[0].Columns["FoodRevenueBudget"].SortIndicator = SortIndicator.None;
            e.Layout.Bands[0].Columns["MealCountBudget"].SortIndicator   = SortIndicator.None;

            ultraGrid1.KeyActionMappings.Add(new GridKeyActionMapping(Keys.Enter, UltraGridAction.NextRow, 0, UltraGridState.Row, Infragistics.Win.SpecialKeys.All, 0));
            ultraGrid1.KeyActionMappings.Add(new GridKeyActionMapping(Keys.Delete, UltraGridAction.DeleteRows, UltraGridState.InEdit, UltraGridState.Row, Infragistics.Win.SpecialKeys.All, 0));
            ultraGrid1.KeyActionMappings.Add(new GridKeyActionMapping(Keys.Back, UltraGridAction.DeleteRows, UltraGridState.InEdit, UltraGridState.Row, Infragistics.Win.SpecialKeys.All, 0));

            //if (!bool.Parse(VWA4Common.SecurityManager.GetSecurityManager().GetPermission("Enter Monthly Financials available")))
            if (!VWA4Common.GlobalSettings.EnterFinancialsAvailable)
            {
                this.ultraGrid1.DisplayLayout.Override.AllowAddNew = Infragistics.Win.UltraWinGrid.AllowAddNew.No;
                this.ultraGrid1.DisplayLayout.Override.AllowDelete = Infragistics.Win.DefaultableBoolean.False;
                this.ultraGrid1.DisplayLayout.Override.AllowUpdate = Infragistics.Win.DefaultableBoolean.False;
            }
        }
Esempio n. 30
0
        private void InicializarColumnas(InitializeLayoutEventArgs e)
        {
            UgSoporteAdmedia.DisplayLayout.AutoFitStyle = AutoFitStyle.ResizeAllColumns;
            e.Layout.Bands[0].Columns[0].Header.Caption = "Código de Vehículo";

            e.Layout.Bands[0].Columns[1].Header.Caption = "Medio";
            e.Layout.Bands[0].Columns[2].Header.Caption = "Soporte";
            e.Layout.Bands[0].Columns[3].Header.Caption = "Tipo de Soporte";
            e.Layout.Bands[0].Columns[4].Header.Caption = "Descripción AdMedia";

            //Ocultar una columna
            //ugSoporteAdmedia.DisplayLayout.Bands[0].Columns["IdSoporte"].Hidden = true;

            //Cargo Dropdown Simple
            ValueList valueList = ObtenerSoporte(e);

            e.Layout.Bands[0].Columns[2].ValueList = valueList;
            //--

            //Cargo Ultra Dropdown
            DataTable tipoDeSoporte = ObtenerTipoDeSoportes();

            this.UltraDropDown1.SetDataBinding(tipoDeSoporte, null);
            this.UltraDropDown1.ValueMember        = "ID";
            this.UltraDropDown1.DisplayMember      = "Descripcion";
            e.Layout.Bands[0].Columns[3].ValueList = this.UltraDropDown1;
            //--

            //Centrar solo una columna
            //e.Layout.Bands[0].Columns[0].CellAppearance.TextHAlign = HAlign.Center;

            //Centrar todas las columnas
            e.Layout.Bands[0].Override.CellAppearance.TextHAlign = HAlign.Center;
        }
Esempio n. 31
0
        private void dgv_DanhSach_InitializeLayout(object sender, InitializeLayoutEventArgs e)
        {
            var band = e.Layout.Bands[0];
            band.ColHeadersVisible = false;

            band.Columns["ID"].Hidden = true;
            band.Columns["Chon"].Style = ColumnStyle.CheckBox;
            band.Columns["Chon"].MaxWidth = 70;
            band.Columns["TenKT"].CellActivation = Activation.NoEdit;
        }
Esempio n. 32
0
        private void dgv_DanhSach_InitializeLayout(object sender, InitializeLayoutEventArgs e)
        {
            var band = e.Layout.Bands[0];
            //band.Columns["STT"].CellActivation = Activation.NoEdit;
            //band.Columns["STT"].CellAppearance.BackColor = Color.LightCyan;
            band.Override.HeaderAppearance.FontData.SizeInPoints = 10;
            band.Override.HeaderAppearance.FontData.Bold = DefaultableBoolean.True;
            #region Size
            //band.Columns["STT"].MinWidth = 50;
            //band.Columns["STT"].MaxWidth = 50;
            band.Columns["MaSV"].MinWidth = 100;
            band.Columns["MaSV"].MaxWidth = 120;
            band.Columns["HoSV"].MinWidth = 130;
            band.Columns["HoSV"].MaxWidth = 150;
            band.Columns["TenSV"].MinWidth = 90;
            band.Columns["TenSV"].MaxWidth = 100;
            band.Columns["NgaySinh"].MinWidth = 100;
            band.Columns["NgaySinh"].MaxWidth = 100;
            band.Columns["Lop"].MinWidth = 100;
            band.Columns["Lop"].MaxWidth = 110;
            //band.Columns["TenKhoa"].MinWidth = 270;
            //band.Columns["TenKhoa"].MaxWidth = 290;
            #endregion
            band.Override.HeaderClickAction = HeaderClickAction.SortSingle;

            #region Caption
            band.Groups.Clear();
            var columns = band.Columns;
            band.ColHeadersVisible = false;
            //var group5 = band.Groups.Add("STT");
            var group0 = band.Groups.Add("Mã SV");
            var group1 = band.Groups.Add("Họ và tên");
            var group2 = band.Groups.Add("Ngày sinh");
            var group3 = band.Groups.Add("Lớp");
            //var group4 = band.Groups.Add("Khoa");
            //columns["STT"].Group = group5;
            columns["MaSV"].Group = group0;
            columns["HoSV"].Group = group1;
            columns["TenSV"].Group = group1;
            columns["NgaySinh"].Group = group2;
            columns["Lop"].Group = group3;
            //columns["TenKhoa"].Group = group4;

            #endregion

            //columns["STT"].CellAppearance.TextHAlign = HAlign.Center;
            columns["MaSV"].CellAppearance.TextHAlign = HAlign.Center;
            columns["NgaySinh"].CellAppearance.TextHAlign = HAlign.Center;
            columns["Lop"].CellAppearance.TextHAlign = HAlign.Center;
        }
Esempio n. 33
0
        private void dgv_DanhSach_InitializeLayout(object sender, InitializeLayoutEventArgs e)
        {
            try
            {
                var band = e.Layout.Bands[0];
                band.Columns["IdKyThi"].Hidden = true;
                band.Columns["DiemThi"].Hidden = true;
                band.Columns["MaSV"].CellAppearance.TextHAlign = HAlign.Center;
                band.Columns["MaDe"].CellAppearance.TextHAlign = HAlign.Center;
                band.Columns["MaHoiDong"].CellAppearance.TextHAlign = HAlign.Center;
                band.Columns["MaLoCham"].CellAppearance.TextHAlign = HAlign.Center;
                band.Columns["TenFile"].CellAppearance.TextHAlign = HAlign.Center;

                band.Columns["MaSV"].CellActivation = Activation.NoEdit;
                band.Columns["MaDe"].CellActivation = Activation.NoEdit;
                band.Columns["KetQua"].CellActivation = Activation.NoEdit;

                band.Override.HeaderAppearance.FontData.SizeInPoints = 11;
                band.Override.HeaderAppearance.FontData.Bold = DefaultableBoolean.True;
                band.Columns["MaSV"].MinWidth = 120;
                band.Columns["MaSV"].MaxWidth = 130;
                band.Columns["MaDe"].MinWidth = 100;
                band.Columns["MaDe"].MaxWidth = 110;
                band.Columns["KetQua"].MinWidth = 640;
                band.Columns["KetQua"].MaxWidth = 650;
                band.Columns["MaHoiDong"].MinWidth = 100;
                band.Columns["MaLoCham"].MinWidth = 100;
                band.Columns["TenFile"].MinWidth = 100;
                band.Columns["MaHoiDong"].MaxWidth = 110;
                band.Columns["MaLoCham"].MaxWidth = 110;
                band.Columns["TenFile"].MaxWidth = 110;
                band.Override.HeaderClickAction = HeaderClickAction.SortSingle;

                #region Caption

                band.Columns["MaSV"].Header.Caption = @"Mã sinh viên";
                band.Columns["MaDe"].Header.Caption = @"Mã đề thi";
                band.Columns["KetQua"].Header.Caption = @"Bài làm sinh viên";
                band.Columns["MaHoiDong"].Header.Caption = @"Hội đồng";
                band.Columns["MaLoCham"].Header.Caption = @"Lô chấm";
                band.Columns["TenFile"].Header.Caption = @"Tên file";

                #endregion
            }
            catch (Exception ex)
            {
                Log2File.LogExceptionToFile(ex);
            }
        }
        /*
         *
         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;
            }
        }
Esempio n. 35
0
        private void dgv_DanhSach_InitializeLayout(object sender, InitializeLayoutEventArgs e)
        {
            try
            {
                var band = e.Layout.Bands[0];

                band.Columns["IdKyThi"].Hidden = true;
                band.Columns["ThangDiem"].Hidden = true;

                band.Override.CellAppearance.TextHAlign = HAlign.Center;
                band.Override.HeaderAppearance.FontData.SizeInPoints = 10;
                band.Override.HeaderAppearance.FontData.Bold = DefaultableBoolean.True;
                band.Columns["MaMon"].MinWidth = 140;
                band.Columns["MaDe"].MinWidth = 140;
                band.Columns["CauHoi"].MinWidth = 140;
                band.Columns["Dapan"].MinWidth = 140;
                band.Columns["MaMon"].MaxWidth = 150;
                band.Columns["MaDe"].MaxWidth = 150;
                band.Columns["CauHoi"].MaxWidth = 150;
                band.Columns["Dapan"].MaxWidth = 150;
                band.Override.HeaderClickAction = HeaderClickAction.SortSingle;

                #region Caption

                band.Columns["MaMon"].Header.Caption = @"Mã môn thi";
                band.Columns["MaDe"].Header.Caption = @"Mã đề thi";
                band.Columns["CauHoi"].Header.Caption = @"Câu hỏi";
                band.Columns["Dapan"].Header.Caption = @"Đáp án";

                #endregion
            }
            catch (Exception ex)
            {
                Log2File.LogExceptionToFile(ex);
            }
        }
Esempio n. 36
0
 public static void SetGridColumnTypes(
     InitializeLayoutEventArgs e,
     bool rightAlignNumericFields,
     string excludeColumn = null)
 {
     foreach (
         UltraGridColumn col in
             e.Layout.Bands.Cast<UltraGridBand>()
              .SelectMany
                 (
                     band => band.Columns.Cast<UltraGridColumn>()
                                 .Where(col => col.Key != excludeColumn))
         )
     {
         //Check datatype
         switch (col.DataType.FullName)
         {
             case "System.String":
                 break;
             case "System.Int32":
                 col.Style = ColumnStyle.Integer;
                 if (rightAlignNumericFields)
                 {
                     col.CellAppearance.TextHAlign = HAlign.Right;
                     col.Header.Appearance.TextHAlign = HAlign.Right;
                 }
                 break;
             case "System.Double":
             case "System.Decimal":
                 col.Style = ColumnStyle.Double;
                 if (rightAlignNumericFields)
                 {
                     col.CellAppearance.TextHAlign = HAlign.Right;
                     col.Header.Appearance.TextHAlign = HAlign.Right;
                 }
                 break;
             case "System.DateTime":
             case "System.Date":
                 col.Style = ColumnStyle.DateTime;
                 break;
             case "System.Boolean":
                 col.Style = ColumnStyle.CheckBox;
                 break;
         }
     }
 }
Esempio n. 37
0
        private void gridEmployeeList_InitializeLayout(object sender, InitializeLayoutEventArgs e)
        {
            e.Layout.Bands[0].Columns["department"].Hidden = true;
            e.Layout.Bands[0].Columns["email"].Hidden = true;
            e.Layout.Bands[0].Columns["telno"].Hidden = true;
            e.Layout.Bands[0].Columns["mobileno"].Hidden = true;
            e.Layout.Bands[0].Columns["grade"].Hidden = true;

            if (!e.Layout.ValueLists.Exists("vlemployeetypeid"))
            {
                e.Layout.ValueLists.Add("vlemployeetypeid");
                e.Layout.ValueLists["vlemployeetypeid"].ValueListItems.AddRange(DropDown.GetValueList_DataTable(GetEmployeeType(), "employeetypename", "employeetypeid"));
                e.Layout.Bands[0].Columns["employeetypeid"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
                e.Layout.Bands[0].Columns["employeetypeid"].ValueList = e.Layout.ValueLists["vlemployeetypeid"];
            }
            if (!e.Layout.ValueLists.Exists("vlworkgroup"))
            {
                e.Layout.ValueLists.Add("vlworkgroup");
                e.Layout.ValueLists["vlworkgroup"].ValueListItems.AddRange(DropDown.GetValueList_DataTable(GetWorkGroup(), "workgroupdesc", "workgroup"));
                e.Layout.Bands[0].Columns["workgroup"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
                e.Layout.Bands[0].Columns["workgroup"].ValueList = e.Layout.ValueLists["vlworkgroup"];
            }
        }
Esempio n. 38
0
 private void listaContiInitializeLayout(object sender, InitializeLayoutEventArgs e)
 {
     var vl = new ValueList();
     e.Layout.Bands[0].Columns["IdSottoConto"].ValueList = vl;
     e.Layout.Bands[0].Columns["IdFornitore"].ValueList = vl;
 }
Esempio n. 39
0
        private void dgv_DanhSach_InitializeLayout(object sender, InitializeLayoutEventArgs e)
        {
            var band = e.Layout.Bands[0];
            band.ColHeadersVisible = false;
            band.Columns["ID"].Hidden = true;
            band.Columns["Chon"].Style = ColumnStyle.CheckBox;

            band.Override.CellAppearance.TextHAlign = HAlign.Center;
            band.Columns["TenPhong"].CellActivation = Activation.NoEdit;
            band.Columns["SucChua"].CellActivation = Activation.NoEdit;
        }
Esempio n. 40
0
 private void dgv_DanhSach_InitializeLayout(object sender, InitializeLayoutEventArgs e)
 {
     var band = e.Layout.Bands[0];
     band.Columns["ID"].Hidden = true;
     band.Columns["STT"].MinWidth = 60;
     band.Columns["STT"].MaxWidth = 70;
     band.Columns["NamHoc"].MinWidth = 190;
     band.Columns["NamHoc"].MaxWidth = 200;
     band.Override.CellAppearance.TextHAlign = HAlign.Center;
     band.Override.HeaderAppearance.FontData.SizeInPoints = 10;
     band.Columns["STT"].CellActivation = Activation.NoEdit;
     band.Columns["STT"].CellAppearance.BackColor = Color.LightCyan;
     band.Columns["NamHoc"].Header.Caption = @"Năm học";
 }
Esempio n. 41
0
 private void cboChonkythi_InitializeLayout(object sender, InitializeLayoutEventArgs e)
 {
     cboChonkythi.Rows.Band.Columns["ID"].Hidden = true;
     cboChonkythi.Rows.Band.Columns["MaKT"].Width = 70;
     cboChonkythi.Rows.Band.Columns["TenKT"].Width = 250;
     cboChonkythi.Rows.Band.ColHeadersVisible = false;
 }
Esempio n. 42
0
        private void grdLineWarehouse_InitializeLayout(object sender, InitializeLayoutEventArgs e)
        {
            e.Layout.Override.AllowUpdate = Infragistics.Win.DefaultableBoolean.True;
            e.Layout.NewColumnLoadStyle = NewColumnLoadStyle.Show;
            e.Layout.ViewStyleBand = Infragistics.Win.UltraWinGrid.ViewStyleBand.Vertical;
            e.Layout.AutoFitStyle = AutoFitStyle.ResizeAllColumns;
            e.Layout.Override.SummaryDisplayArea = SummaryDisplayAreas.Default;

            e.Layout.Bands[0].Columns["cartonno"].SortComparer = new CartonNoComparer();

            if (!e.Layout.ValueLists.Exists("vlchecktype"))
            {
                e.Layout.ValueLists.Add("vlchecktype");
                e.Layout.ValueLists["vlchecktype"].ValueListItems.AddRange(DropDown.GetValueList_StaticValue(MES_StaticValue_Type.CheckType));
                e.Layout.Bands[0].Columns["checktype"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
                e.Layout.Bands[0].Columns["checktype"].ValueList = e.Layout.ValueLists["vlchecktype"];
            }

            foreach (UltraGridColumn col in e.Layout.Bands[0].Columns)
            {
                col.CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
                if (!lineWarehouseColumns.Contains(col.Key))
                {
                    col.Hidden = true;
                }
            }
            e.Layout.Bands[0].Columns["customerid"].Hidden = true;

            if (e.Layout.Bands.Count > 1)
            {
                foreach (UltraGridColumn col in e.Layout.Bands[1].Columns)
                {
                    col.CellActivation = Infragistics.Win.UltraWinGrid.Activation.NoEdit;
                    if (!subLineWarehouseColumns.Contains(col.Key))
                    {
                        col.Hidden = true;
                    }
                }
                for (int i = 0; i < subLineWarehouseColumns.Count(); i++)
                {
                    e.Layout.Bands[1].Columns[subLineWarehouseColumns[i]].Header.VisiblePosition = i;
                }

                e.Layout.Bands[1].Columns["styleno"].Header.Caption = UtilCulture.GetString("Label.R01026");
                e.Layout.Bands[1].Columns["color"].Header.Caption = UtilCulture.GetString("Label.R01027");
                e.Layout.Bands[1].Columns["size"].Header.Caption = UtilCulture.GetString("Label.R01028");
                e.Layout.Bands[1].Columns["pairqty"].Header.Caption = UtilCulture.GetString("Label.R02026");

                //e.Layout.Bands[1].Override.SummaryFooterCaptionVisible = DefaultableBoolean.False;
                //if (!e.Layout.Bands[1].Summaries.Exists("SumPairqty"))
                //{
                //    e.Layout.Bands[1].Summaries.Add("SumPairqty", SummaryType.Sum, e.Layout.Bands[1].Columns["pairqty"], SummaryPosition.UseSummaryPositionColumn);
                //}
            }

            e.Layout.Bands[0].Override.SummaryFooterCaptionVisible = DefaultableBoolean.False;
            if (!e.Layout.Bands[0].Summaries.Exists("SumCartonQty"))
            {
                e.Layout.Bands[0].Summaries.Add("SumCartonQty", SummaryType.Count, e.Layout.Bands[0].Columns["cartonno"], SummaryPosition.UseSummaryPositionColumn);
            }
            if (!e.Layout.Bands[0].Summaries.Exists("SumPairqty"))
            {
                e.Layout.Bands[0].Summaries.Add("SumPairqty", SummaryType.Sum, e.Layout.Bands[0].Columns["pairqty"], SummaryPosition.UseSummaryPositionColumn);
            }
        }
Esempio n. 43
0
        private void dgv_DanhSach_InitializeLayout(object sender, InitializeLayoutEventArgs e)
        {
            try
            {
                var band = e.Layout.Bands[0];
                band.Groups.Clear();
                band.Columns["IdNamHoc"].Hidden = true;
                band.Override.HeaderAppearance.FontData.Bold = DefaultableBoolean.True;
                band.Override.HeaderAppearance.FontData.SizeInPoints = 10;
                band.Columns["STT"].CellActivation = Activation.NoEdit;
                band.Columns["STT"].CellAppearance.BackColor = Color.LightCyan;

                #region Caption
                var columns = band.Columns;
                band.ColHeadersVisible = false;
                var group6 = band.Groups.Add("STT");
                var group0 = band.Groups.Add("Mã SV");
                var group1 = band.Groups.Add("Họ và tên");
                var group7 = band.Groups.Add("Lớp");
                var group2 = band.Groups.Add("Ngày sinh");
                var group3 = band.Groups.Add("Năm học");
                var group4 = band.Groups.Add("Học kỳ");
                var group5 = band.Groups.Add("Điểm");
                columns["STT"].Group = group6;
                columns["MaSV"].Group = group0;
                columns["HoSV"].Group = group1;
                columns["TenSV"].Group = group1;
                columns["MaLop"].Group = group7;
                columns["NgaySinh"].Group = group2;
                columns["NamHoc"].Group = group3;
                columns["HocKy"].Group = group4;
                columns["Diem"].Group = group5;

                #endregion

                #region Size

                band.Columns["STT"].MinWidth = 60;
                band.Columns["STT"].MaxWidth = 70;
                band.Columns["MaSV"].MinWidth = 100;
                band.Columns["MaSV"].MaxWidth = 120;
                band.Columns["HoSV"].MinWidth = 130;
                band.Columns["HoSV"].MaxWidth = 150;
                band.Columns["TenSV"].MinWidth = 90;
                band.Columns["TenSV"].MaxWidth = 100;
                band.Columns["MaLop"].MinWidth = 90;
                band.Columns["MaLop"].MaxWidth = 100;
                band.Columns["NgaySinh"].MinWidth = 100;
                band.Columns["NgaySinh"].MaxWidth = 100;
                band.Columns["NamHoc"].MinWidth = 140;
                band.Columns["NamHoc"].MaxWidth = 150;
                band.Columns["HocKy"].MinWidth = 100;
                band.Columns["HocKy"].MaxWidth = 110;
                band.Columns["Diem"].MinWidth = 100;
                band.Columns["Diem"].MaxWidth = 120;

                #endregion

                columns["STT"].CellAppearance.TextHAlign = HAlign.Center;
                columns["MaSV"].CellAppearance.TextHAlign = HAlign.Center;
                columns["NamHoc"].CellAppearance.TextHAlign = HAlign.Center;
                columns["Diem"].CellAppearance.TextHAlign = HAlign.Center;
                columns["TenSV"].CellAppearance.TextHAlign = HAlign.Center;
                columns["MaLop"].CellAppearance.TextHAlign = HAlign.Center;
                columns["HocKy"].CellAppearance.TextHAlign = HAlign.Center;

                foreach (var column in band.Columns)
                {
                    column.CellActivation = Activation.NoEdit;
                }

                dgv_DanhSach.DisplayLayout.UseFixedHeaders = true;
                dgv_DanhSach.DisplayLayout.FixedHeaderOffImage = Properties.Resources.trang;
                dgv_DanhSach.DisplayLayout.FixedHeaderOnImage = Properties.Resources.trang;
                group0.Header.Fixed = true;
                group1.Header.Fixed = true;
                group2.Header.Fixed = true;
                group6.Header.Fixed = true;
                group7.Header.Fixed = true;
            }
            catch (Exception ex)
            {
                Log2File.LogExceptionToFile(ex);
            }
        }
Esempio n. 44
0
 private void gridCustomerList_InitializeLayout(object sender, InitializeLayoutEventArgs e)
 {
     e.Layout.Bands[0].Columns["MANAGER"].Hidden = true;
     e.Layout.Bands[0].Columns["SHIPTOADDRESS"].Hidden = true;
 }
Esempio n. 45
0
 private void listaInitializeLayout(object sender, InitializeLayoutEventArgs e)
 {
     e.Layout.Bands[0].PerformAutoResizeColumns(false, PerformAutoSizeType.AllRowsInBand);
     e.Layout.Override.RowSizing = RowSizing.AutoFree;
     e.Layout.Bands[0].Columns["Checksum"].EditorComponent = ultraControlContainerEditor1;
 }
        private void uG_DanhSach_InitializeLayout(object sender, InitializeLayoutEventArgs e)
        {
            try
            {
                var band = e.Layout.Bands[0];
                //band.Override.HeaderAppearance.FontData.SizeInPoints = 11;
                band.Override.HeaderAppearance.FontData.Bold = DefaultableBoolean.True;

                #region Caption

                band.Columns["TaiKhoan"].Header.Caption = FormResource.txtTenTaiKhoan;
                band.Columns["HoTen"].Header.Caption = FormResource.txtTenNguoiDung;
                band.Columns["MatKhau"].Header.Caption = FormResource.txtMatKhau;
                band.Columns["Quyen"].Header.Caption = FormResource.txtQuyen;

                #endregion

                band.Columns["STT"].MaxWidth = 70;
                //band.Columns["MatKhau"].Width = 150;
                //band.Columns["HoTen"].Width = 200;
                //band.Columns["TaiKhoan"].Width = 150;

                band.Columns["ID"].Hidden = true;
                band.Override.CellAppearance.TextHAlign = HAlign.Center;
                band.Columns["STT"].CellActivation = Activation.NoEdit;
                band.Columns["STT"].CellAppearance.BackColor = Color.LightCyan;
                band.Columns["Quyen"].EditorComponent = CboQuyen();
                band.Columns["Quyen"].Style = ColumnStyle.DropDownList;

                dgv_DanhSach.DisplayLayout.UseFixedHeaders = true;
                band.Override.FixedHeaderIndicator = FixedHeaderIndicator.None;
                band.Columns["STT"].Header.Fixed = true;
                band.Columns["TaiKhoan"].Header.Fixed = true;
                band.Columns["MatKhau"].Header.Fixed = true;

            }
            catch (Exception ex)
            {
                Log2File.LogExceptionToFile(ex);
            }
        }
Esempio n. 47
0
        private void uG_DanhSach_InitializeLayout(object sender, InitializeLayoutEventArgs e)
        {
            try
            {
                var band = e.Layout.Bands[0];
                band.Columns["ID"].Hidden = true;
                band.Override.CellAppearance.TextHAlign = HAlign.Center;
                band.Columns["STT"].CellActivation = Activation.NoEdit;
                band.Columns["STT"].CellAppearance.BackColor = Color.LightCyan;
                #region MyRegion

                band.Columns["STT"].MinWidth = 50;
                band.Columns["STT"].MaxWidth = 60;
                band.Columns["TenPhong"].MinWidth = 100;
                band.Columns["TenPhong"].MaxWidth = 120;
                band.Columns["SucChua"].MinWidth = 100;
                band.Columns["SucChua"].MaxWidth = 120;

                #endregion

                band.Override.HeaderAppearance.TextHAlign = HAlign.Center;
                band.Override.HeaderAppearance.FontData.SizeInPoints = 10;
                band.Override.HeaderAppearance.FontData.Bold = DefaultableBoolean.True;
                band.Columns["SucChua"].FormatNumberic();

                #region Caption

                band.Columns["TenPhong"].Header.Caption = @"Tên phòng";
                band.Columns["SucChua"].Header.Caption = @"Sức chứa";
                band.Columns["GhiChu"].Header.Caption = @"Ghi chú";

                #endregion
            }
            catch (Exception ex)
            {
                Log2File.LogExceptionToFile(ex);
            }
        }
Esempio n. 48
0
        void ug_list_InitializeLayout(object sender, InitializeLayoutEventArgs e)
        {
            UltraGrid ug_list = sender as UltraGrid;
            Sys_PD_RefModule refModuleData = new Sys_PD_RefModule();
            int i = 0;
            //ug_list.DisplayLayout.Appearance.FontData.SizeInPoints = (float)30;
            //ug_list.ResetDisplayLayout();
            //绑定每一列,并修改表头
            Sys_PD_Module module = new Sys_PD_Module();
            GridTagObject gridObj = ug_list.Tag as GridTagObject;
            module = gridObj.Module;
            //module = ug_list.Tag as Sys_PD_Module;
            List<Sys_PD_Filed> filedList = new List<Sys_PD_Filed>();
            filedList = instField.GetListByWhere(" and DCP_ModuleName='" + module.SPM_Module + "' order by DCP_Order ASC").ToList();

            //			 e.Layout.Bands[0].Columns["price"].MaskInput= "$#,###.##";

            Infragistics.Win.UltraWinGrid.UltraGridColumn ugCol;
            for (i = 0; i < e.Layout.Bands[0].Columns.Count; i++)//使所有的都不能编辑
            {
                ugCol = e.Layout.Bands[0].Columns[i];
                //使其不能在Grid上编辑
                ugCol.CellActivation = Activation.NoEdit;
                ugCol.Hidden = true;
                //ugCol.Header.te

            }
            ug_list.DisplayLayout.Bands[0].Summaries.Clear();

            foreach (Sys_PD_Filed field in filedList)
            {
                UltraGridBand band = e.Layout.Bands[0];
                if (band.Columns.Exists(field.DCP_ControlID))
                {
                    band.Columns[field.DCP_ControlID].Header.Caption = field.DCP_Label;
                    band.Columns[field.DCP_ControlID].Hidden = field.DCP_IsHidden == 1 ? true : false;
                    band.Columns[field.DCP_ControlID].Tag = field;//置tag属性,保存列的配置属性
                    band.Columns[field.DCP_ControlID].Header.VisiblePosition = field.DCP_Order;
                    band.Columns[field.DCP_ControlID].CellActivation = Activation.AllowEdit;

                }
                else
                {
                    continue;
                }

                if (field.DCP_IsSummary > 0)
                {
                    ug_list.DisplayLayout.Bands[0].Columns[field.DCP_ControlID].AllowRowSummaries = AllowRowSummaries.SingleSummaryBasedOnDataType;

                    ug_list.DisplayLayout.Bands[0].Summaries.Add(SummaryType.Sum, ug_list.DisplayLayout.Bands[0].Columns[field.DCP_ControlID]);
                    ug_list.DisplayLayout.Bands[0].SummaryFooterCaption = "合计";
                }

                //绑定编辑的控件
                switch (field.DCP_ControlType)
                {
                    case "text":
                        if (field.DCP_IsReadonly == 1)
                        {
                            band.Columns[field.DCP_ControlID].CellClickAction = CellClickAction.RowSelect;
                        }
                        break;
                    case "dec":
                        band.Columns[field.DCP_ControlID].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Double;
                        band.Columns[field.DCP_ControlID].PromptChar = ' ';
                        band.Columns[field.DCP_ControlID].MaskDisplayMode = Infragistics.Win.UltraWinMaskedEdit.MaskMode.Raw;
                        band.Columns[field.DCP_ControlID].MaskDataMode = Infragistics.Win.UltraWinMaskedEdit.MaskMode.Raw;
                        if (field.DCP_IsReadonly == 1)
                        {
                            band.Columns[field.DCP_ControlID].CellClickAction = CellClickAction.RowSelect;
                        }

                        break;
                    case "int":
                        band.Columns[field.DCP_ControlID].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Integer;

                        if (field.DCP_IsReadonly == 1)
                        {
                            band.Columns[field.DCP_ControlID].CellClickAction = CellClickAction.RowSelect;
                        }
                        break;
                    case "check":
                        band.Columns[field.DCP_ControlID].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.CheckBox;

                        if (field.DCP_IsReadonly == 1)
                        {
                            band.Columns[field.DCP_ControlID].CellClickAction = CellClickAction.RowSelect;
                        }
                        break;
                    case "date":
                        band.Columns[field.DCP_ControlID].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Date;
                        band.Columns[field.DCP_ControlID].MaskInput = "yyyy-mm-dd";
                        //band.Columns[field.DCP_ControlID].DefaultCellValue = DateTime.Now;

                        if (field.DCP_IsReadonly == 1)
                        {
                            band.Columns[field.DCP_ControlID].CellClickAction = CellClickAction.RowSelect;
                        }
                        break;
                    case "time":
                        band.Columns[field.DCP_ControlID].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DateTimeWithoutDropDown;
                        band.Columns[field.DCP_ControlID].MaskInput = "yyyy-mm-dd hh:mm";
                        //band.Columns[field.DCP_ControlID].DefaultCellValue = DateTime.Now;

                        if (field.DCP_IsReadonly == 1)
                        {
                            band.Columns[field.DCP_ControlID].CellClickAction = CellClickAction.RowSelect;
                        }
                        break;
                    case "dict":
                        var dict = instDict.GetListByWhere(string.Format(" and dict_key='{0}' and dict_code <>'{0}' order by dict_order ", field.DCP_Type));
                        var valueList = new ValueList();
                        foreach (var obj in dict)
                        {
                            valueList.ValueListItems.Add(obj.Dict_Code, obj.Dict_Name);
                        }
                        band.Columns[field.DCP_ControlID].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
                        band.Columns[field.DCP_ControlID].ValueList = valueList;
                        band.Columns[field.DCP_ControlID].ButtonDisplayStyle = Infragistics.Win.UltraWinGrid.ButtonDisplayStyle.OnCellActivate;

                        if (field.DCP_IsReadonly == 1)
                        {
                            band.Columns[field.DCP_ControlID].CellClickAction = CellClickAction.RowSelect;
                        }
                        break;
                    case "ref":
                        //e.Layout.Bands[0].Columns[field.DCP_ControlID].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.ul;
                        UltraDropDown drop = new UltraDropDown();
                        string sql = string.Empty;
                        //if (!string.IsNullOrEmpty(field.DCP_RefSQL))
                        //{
                        //    sql = string.Format(field.DCP_RefSQL, "");
                        //MethodInvoker exc = delegate
                        //{
                        ADOSys_PD_RefModule refInst = new ADOSys_PD_RefModule();
                        Sys_PD_RefModule refModule = refInst.GetListByWhere(string.Format(" and SPR_RefModule='{0}'", field.DCP_RefSQL)).FirstOrDefault();

                        if (refModule != null && !string.IsNullOrEmpty(field.DCP_RefSQL))
                        {

                            sql = refModule.SPR_RefSQL.Trim();
                            DataTable refDate = new DataTable();
                            refDate = instField.GetRefData(sql);
                            drop.DataSource = refDate.DefaultView;
                            drop.DisplayMember = field.DCP_RefValue;
                            drop.ValueMember = field.DCP_RefCode;

                            drop.Tag = field;

                            //drop.v += new EventHandler(drop_TextChanged);
                            band.Columns[field.DCP_ControlID].ValueList = drop;
                            band.Columns[field.DCP_ControlID].AutoCompleteMode = Infragistics.Win.AutoCompleteMode.SuggestAppend;

                            if (field.DCP_IsReadonly == 1)
                            {
                                band.Columns[field.DCP_ControlID].CellClickAction = CellClickAction.RowSelect;
                            }
                            drop.Rows.ColumnFilters[field.DCP_RefValue].FilterConditions.Add(FilterComparisionOperator.Contains, drop.Text);
                        }
                        else
                        {
                            DataTable refDate = new DataTable();
                            drop.DataSource = refDate.DefaultView;
                            drop.DisplayMember = field.DCP_RefValue;
                            drop.ValueMember = field.DCP_RefCode;
                            //drop.v += new EventHandler(drop_TextChanged);
                            band.Columns[field.DCP_ControlID].ValueList = drop;
                            band.Columns[field.DCP_ControlID].AutoCompleteMode = Infragistics.Win.AutoCompleteMode.SuggestAppend;

                            if (field.DCP_IsReadonly == 1)
                            {
                                band.Columns[field.DCP_ControlID].CellClickAction = CellClickAction.RowSelect;
                            }

                            //drop.Rows.ColumnFilters[field.DCP_RefValue].FilterConditions.Add(FilterComparisionOperator.Contains, drop.Text);
                        }
                        //};

                        //exc.BeginInvoke(null, null);

                        //}

                        break;
                }
            }
            if (module.SPM_IsFilter > 0)
            {
                SetExcelStyleFilter(ug_list);
            }
            ug_list.DisplayLayout.AutoFitStyle = AutoFitStyle.ExtendLastColumn;
            GridFormater.RetrieveSetGridFormat(ug_list, ug_list.DisplayLayout.Bands[0], module.SPM_Module, SessionConfig.UserID);
        }
Esempio n. 49
0
 private void ricercaCondominioInitializeLayout(object sender, InitializeLayoutEventArgs e)
 {
     e.Layout.Override.FilterOperatorLocation = FilterOperatorLocation.WithOperand;
     e.Layout.Override.FilterRowAppearance.BackColor = Color.LightYellow;
     e.Layout.Override.FilterRowPrompt = @"Clicca qui per filtrare i dati...";
     e.Layout.Override.FilterRowPromptAppearance.BackColorAlpha = Alpha.Opaque;
     e.Layout.Override.SpecialRowSeparator = SpecialRowSeparator.FilterRow;
 }
        private void uG_DanhSach_InitializeLayout(object sender, InitializeLayoutEventArgs e)
        {
            try
            {
                var band = e.Layout.Bands[0];
                band.Columns["ID"].Hidden = true;
                band.Columns["STT"].CellAppearance.TextHAlign = HAlign.Center;
                band.Columns["STT"].CellActivation = Activation.NoEdit;
                band.Columns["STT"].CellAppearance.BackColor = Color.LightCyan;
                band.Columns["STT"].MaxWidth = 70;
                band.Override.HeaderAppearance.TextHAlign = HAlign.Center;
                band.Override.HeaderAppearance.FontData.SizeInPoints = 10;
                band.Override.HeaderAppearance.FontData.Bold = DefaultableBoolean.True;

                #region Caption

                band.Columns["TenKhoa"].Header.Caption = FormResource.txtTenkhoa;

                #endregion
            }
            catch (Exception ex)
            {
                Log2File.LogExceptionToFile(ex);
            }
        }
Esempio n. 51
0
 private void contiInitializeLayout(object sender, InitializeLayoutEventArgs e)
 {
     if (conti.DisplayLayout.Bands[0].Columns.Exists("PercentualeProprieta"))
         conti.DisplayLayout.Bands[0].Columns["PercentualeProprieta"].Editor.DataFilter = new PercentageDataFilter();
 }
Esempio n. 52
0
 private void ultraGrid1_InitializeLayout(object sender, InitializeLayoutEventArgs e)
 {
 }
Esempio n. 53
0
        private void ricercaModelliInitializeLayout(object sender, InitializeLayoutEventArgs e)
        {
            //e.Layout.Override.FilterOperandStyle = FilterOperandStyle.Combo;

            e.Layout.Override.FilterOperatorLocation = FilterOperatorLocation.WithOperand;

            //e.Layout.Override.FilterOperatorDropDownItems = FilterOperatorDropDownItems.All;

            e.Layout.Override.FilterRowAppearance.BackColor = Color.LightYellow;
            e.Layout.Override.FilterRowPrompt = @"Clicca qui per filtrare i dati...";
            e.Layout.Override.FilterRowPromptAppearance.BackColorAlpha = Alpha.Opaque;
            e.Layout.Override.SpecialRowSeparator = SpecialRowSeparator.FilterRow;
        }
Esempio n. 54
0
        private void listaInitializeLayout(object sender, InitializeLayoutEventArgs e)
        {
            if (!e.Layout.ValueLists.Exists("Alert"))
            {
                // Create a ValueList with an image for each item.
                var priorityList = e.Layout.ValueLists.Add("Alert");
                var vli = priorityList.ValueListItems.Add("InAttesa");
                vli.Appearance.Image = MessaggisticaResources.attenzione;
                vli = priorityList.ValueListItems.Add("Fallito");
                vli.Appearance.Image = MessaggisticaResources.fallito;
                vli = priorityList.ValueListItems.Add("Ricevuto");
                vli.Appearance.Image = MessaggisticaResources.ricevuto;

                // Set the DisplayStyle to Picture so that the list displays only pictures,
                // and no text.
                priorityList.DisplayStyle = ValueListDisplayStyle.Picture;

                // Assign the ValueList to the column
                e.Layout.Bands[0].Columns["StatoMessaggio"].ValueList = priorityList;

                // Don't allow editing.
                e.Layout.Bands[0].Columns["StatoMessaggio"].CellActivation = Activation.NoEdit;
            }
        }
        private void dgv_DanhSach_InitializeLayout(object sender, InitializeLayoutEventArgs e)
        {
            var band = e.Layout.Bands[0];
            band.Groups.Clear();
            band.Override.HeaderAppearance.FontData.Bold = DefaultableBoolean.True;
            band.Override.HeaderAppearance.FontData.SizeInPoints = 10;

            #region Caption
            var columns = band.Columns;
            band.ColHeadersVisible = false;
            var group0 = band.Groups.Add("STT");
            var group1 = band.Groups.Add("Mã SV");
            var group2 = band.Groups.Add("Họ và tên");
            var group3 = band.Groups.Add("Ngày sinh");
            var group4 = band.Groups.Add("Lớp");
            var group5 = band.Groups.Add("Điểm thi");
            columns["STT"].Group = group0;
            columns["MaSV"].Group = group1;
            columns["HoSV"].Group = group2;
            columns["TenSV"].Group = group2;
            columns["NgaySinh"].Group = group3;
            columns["MaLop"].Group = group4;
            columns["DiemThi"].Group = group5;

            #endregion

            band.Columns["STT"].CellActivation = Activation.NoEdit;
            band.Columns["MaSV"].CellActivation = Activation.NoEdit;
            band.Columns["HoSV"].CellActivation = Activation.NoEdit;
            band.Columns["TenSV"].CellActivation = Activation.NoEdit;
            band.Columns["NgaySinh"].CellActivation = Activation.NoEdit;
            band.Columns["MaLop"].CellActivation = Activation.NoEdit;
            band.Columns["DiemThi"].CellActivation = Activation.NoEdit;

            band.Columns["STT"].CellAppearance.TextHAlign = HAlign.Center;
            band.Columns["MaSV"].CellAppearance.TextHAlign = HAlign.Center;
            band.Columns["TenSV"].CellAppearance.TextHAlign = HAlign.Center;
            band.Columns["MaLop"].CellAppearance.TextHAlign = HAlign.Center;
            band.Columns["NgaySinh"].CellAppearance.TextHAlign = HAlign.Center;
            band.Columns["DiemThi"].CellAppearance.TextHAlign = HAlign.Center;

            band.Columns["STT"].CellAppearance.BackColor = Color.LightCyan;
            #region Size

            band.Columns["STT"].MinWidth = 60;
            band.Columns["STT"].MaxWidth = 80;
            band.Columns["MaSV"].MinWidth = 100;
            band.Columns["MaSV"].MaxWidth = 120;
            band.Columns["HoSV"].MinWidth = 130;
            band.Columns["HoSV"].MaxWidth = 150;
            band.Columns["TenSV"].MinWidth = 90;
            band.Columns["TenSV"].MaxWidth = 100;
            band.Columns["NgaySinh"].MinWidth = 100;
            band.Columns["NgaySinh"].MaxWidth = 100;
            band.Columns["MaLop"].MinWidth = 100;
            band.Columns["MaLop"].MaxWidth = 110;
            band.Columns["DiemThi"].MinWidth = 100;
            band.Columns["DiemThi"].MaxWidth = 120;

            #endregion

            dgv_DanhSach.DisplayLayout.UseFixedHeaders = true;
            dgv_DanhSach.DisplayLayout.FixedHeaderOffImage = Properties.Resources.trang;
            dgv_DanhSach.DisplayLayout.FixedHeaderOnImage = Properties.Resources.trang;
            group0.Header.Fixed = true;
            group1.Header.Fixed = true;
            group2.Header.Fixed = true;
            group3.Header.Fixed = true;
            group4.Header.Fixed = true;
        }
        private void uG_DanhSach_InitializeLayout(object sender, InitializeLayoutEventArgs e)
        {
            try
            {
                var band = e.Layout.Bands[0];

                band.Override.HeaderAppearance.FontData.Bold = DefaultableBoolean.True;
                band.Override.HeaderAppearance.FontData.SizeInPoints = 10;
                #region Caption
                band.Groups.Clear();
                var columns = band.Columns;
                band.ColHeadersVisible = false;
                var group5 = band.Groups.Add("STT");
                var group0 = band.Groups.Add("Mã SV");
                var group1 = band.Groups.Add("Họ và tên");
                var group2 = band.Groups.Add("Ngày sinh");
                var group3 = band.Groups.Add("Lớp");
                var group4 = band.Groups.Add("Khoa");
                columns["STT"].Group = group5;
                columns["MaSV"].Group = group0;
                columns["HoSV"].Group = group1;
                columns["TenSV"].Group = group1;
                columns["NgaySinh"].Group = group2;
                columns["MaLop"].Group = group3;
                columns["TenKhoa"].Group = group4;

                #endregion

                band.Columns["STT"].CellActivation = Activation.NoEdit;
                band.Columns["MaSV"].CellActivation = Activation.NoEdit;
                band.Columns["HoSV"].CellActivation = Activation.NoEdit;
                band.Columns["TenSV"].CellActivation = Activation.NoEdit;
                band.Columns["NgaySinh"].CellActivation = Activation.NoEdit;
                band.Columns["MaLop"].CellActivation = Activation.NoEdit;
                band.Columns["TenKhoa"].CellActivation = Activation.NoEdit;

                band.Columns["STT"].CellAppearance.TextHAlign = HAlign.Center;
                band.Columns["MaSV"].CellAppearance.TextHAlign = HAlign.Center;
                band.Columns["TenSV"].CellAppearance.TextHAlign = HAlign.Center;
                band.Columns["MaLop"].CellAppearance.TextHAlign = HAlign.Center;

                band.Columns["IdLop"].Hidden = true;
                band.Columns["IdKhoa"].Hidden = true;
                band.Columns["STT"].CellAppearance.BackColor = Color.LightCyan;
                #region Size
                band.Columns["STT"].MinWidth = 50;
                band.Columns["STT"].MaxWidth = 50;
                band.Columns["MaSV"].MinWidth = 100;
                band.Columns["MaSV"].MaxWidth = 120;
                band.Columns["HoSV"].MinWidth = 130;
                band.Columns["HoSV"].MaxWidth = 150;
                band.Columns["TenSV"].MinWidth = 90;
                band.Columns["TenSV"].MaxWidth = 100;
                band.Columns["NgaySinh"].MinWidth = 100;
                band.Columns["NgaySinh"].MaxWidth = 100;
                band.Columns["MaLop"].MinWidth = 100;
                band.Columns["MaLop"].MaxWidth = 110;
                band.Columns["TenKhoa"].MinWidth = 270;
                band.Columns["TenKhoa"].MaxWidth = 290;
                #endregion
            }
            catch (Exception ex)
            {
                Log2File.LogExceptionToFile(ex);
            }
        }
Esempio n. 57
0
        private void ultraGridDelegation_InitializeLayout(object sender, InitializeLayoutEventArgs e)
        {
            e.Layout.Bands[0].Columns["DelegationValueId"].Hidden = true;
            e.Layout.Bands[0].Columns["DelegationFunctionId"].Hidden = true;
            e.Layout.Bands[0].Columns["VersionNo"].Hidden = true;
            e.Layout.Bands[0].Columns["DelegationFunctionName"].Header.Caption = "Delegation function";
            e.Layout.AutoFitStyle = Infragistics.Win.UltraWinGrid.AutoFitStyle.ResizeAllColumns;

            for (int i = 0; i <= e.Layout.Bands[0].Columns.Count - 1; i++)
            {
                e.Layout.Bands[0].Columns[i].CellActivation = Activation.NoEdit;
            }
        }
Esempio n. 58
0
        private void listaRiepilogoInitializeLayout(object sender, InitializeLayoutEventArgs e)
        {
            if (!e.Layout.ValueLists.Exists("Alert"))
            {
                // Create a ValueList with an image for each item.
                var alertList = e.Layout.ValueLists.Add("Alert");
                var vli = alertList.ValueListItems.Add(1);
                vli.Appearance.Image = SollecitiResources.pericolo;

                // Set the DisplayStyle to Picture so that the list displays only pictures,
                // and no text.
                alertList.DisplayStyle = ValueListDisplayStyle.Picture;

                // Assign the ValueList to the column
                e.Layout.Bands[0].Columns["NonSollecitare"].ValueList = alertList;

                // Don't allow editing.
                e.Layout.Bands[0].Columns["NonSollecitare"].CellActivation = Activation.NoEdit;
            }
        }
Esempio n. 59
0
        private void uG_DanhSach_InitializeLayout(object sender, InitializeLayoutEventArgs e)
        {
            try
            {
                var band = e.Layout.Bands[0];
                band.Columns["ID"].Hidden = true;
                band.Columns["IdKhoa"].Hidden = true;
                band.Columns["STT"].CellAppearance.TextHAlign = HAlign.Center;
                band.Columns["MaLop"].CellAppearance.TextHAlign = HAlign.Center;
                band.Columns["STT"].CellAppearance.BackColor = Color.LightCyan;
                band.Columns["STT"].CellActivation = Activation.NoEdit;
                band.Columns["TenKhoa"].CellActivation = Activation.NoEdit;
                band.Columns["MaLop"].CellActivation = Activation.NoEdit;
                #region MyRegion
                band.Columns["STT"].MinWidth = 50;
                band.Columns["STT"].MaxWidth = 70;
                band.Columns["MaLop"].MinWidth = 100;
                band.Columns["MaLop"].MaxWidth = 120;
                band.Columns["IdKhoa"].MinWidth = 250;
                band.Columns["IdKhoa"].MaxWidth = 300;
                #endregion

                band.Override.HeaderAppearance.TextHAlign = HAlign.Center;
                band.Override.HeaderAppearance.FontData.SizeInPoints = 10;
                band.Override.HeaderAppearance.FontData.Bold = DefaultableBoolean.True;
                #region Caption

                band.Columns["MaLop"].Header.Caption = @"Mã lớp";
                band.Columns["TenKhoa"].Header.Caption = @"Tên khoa";

                #endregion

                band.Override.HeaderClickAction = HeaderClickAction.SortSingle;
            }
            catch (Exception ex)
            {
                Log2File.LogExceptionToFile(ex);
            }
        }
Esempio n. 60
0
 //Set grid column data types
 public static void SetGridColumnTypes(InitializeLayoutEventArgs e)
 {
     //Loop all bands
     foreach (UltraGridBand band in e.Layout.Bands)
     {
         //Loop all grid columns
         foreach (UltraGridColumn col in band.Columns)
         {
             //Check datatype
             switch (col.DataType.FullName)
             {
                 case "System.String":
                     break;
                 case "System.Int32":
                     col.Style = ColumnStyle.Integer;
                     col.CellAppearance.TextHAlign = HAlign.Right;
                     col.Header.Appearance.TextHAlign = HAlign.Right;
                     break;
                 case "System.Double":
                 case "System.Decimal":
                     col.Style = ColumnStyle.Double;
                     col.CellAppearance.TextHAlign = HAlign.Right;
                     col.Header.Appearance.TextHAlign = HAlign.Right;
                     break;
                 case "System.DateTime":
                 case "System.Date":
                     col.Style = ColumnStyle.DateTime;
                     break;
                 case "System.Boolean":
                     col.Style = ColumnStyle.CheckBox;
                     break;
             }
         }
     }
 }