Example #1
0
        private void InitForm()
        {
            var categories = new List <CategorieView>
            {
                //new CategorieView
                //{
                //    Id = -1,
                //    Intitule = "<Toutes>"
                //}
            };

            categories.AddRange(_controller.GetAllCategories().ToList());
            gleCategorie.Properties.DisplayMember = "Intitule";
            gleCategorie.Properties.ValueMember   = "Id";
            gleCategorie.Properties.View.Columns.Add(new GridColumn
            {
                Caption   = "Initulé",
                FieldName = "Intitule",
                Visible   = true
            });
            gleCategorie.Properties.DataSource     = categories;
            gleCategorie.Properties.ImmediatePopup = true;
            gleCategorie.Properties.View.OptionsView.ShowColumnHeaders = false;
            gleCategorie.Properties.ShowFooter = false;
            gleCategorie.Properties.View.OptionsView.ShowIndicator = false;
            gleCategorie.Properties.PopupFormSize = new Size(30, 30);


            txtEtablissement.Properties.DisplayMember = "Intitule";
            txtEtablissement.Properties.ValueMember   = "Id";
            txtEtablissement.Properties.View.Columns.Add(new GridColumn
            {
                Caption   = "Initulé",
                FieldName = "Intitule",
                Visible   = true
            });
            txtEtablissement.Properties.DataSource     = _controller.GetEtb();
            txtEtablissement.Properties.ImmediatePopup = true;
            txtEtablissement.Properties.View.OptionsView.ShowColumnHeaders = false;
            txtEtablissement.Properties.ShowFooter = false;
            txtEtablissement.Properties.View.OptionsView.ShowIndicator = false;
            txtEtablissement.Properties.PopupFormSize = new Size(30, 30);
        }
Example #2
0
        private void InitGridLigneDeclaration()
        {
            var repoCivilite = new RepositoryItemImageComboBox();

            repoCivilite.Items.AddEnum(typeof(Civilite));

            var repoSituationFamille = new RepositoryItemImageComboBox();

            repoSituationFamille.Items.AddEnum(typeof(SituationFamille));
            // Repository Mode de reglement
            var repo = new RepositoryItemGridLookUpEdit
            {
                DataSource    = _controller.GetAllCategories(),
                DisplayMember = "Intitule",
                ValueMember   = "No"
            };

            repo.View.Columns.Add(new GridColumn
            {
                Caption   = @"No",
                FieldName = "No",
                Visible   = true,
                MaxWidth  = 30
            });
            repo.View.Columns.Add(new GridColumn
            {
                Caption   = @"Intitulé",
                FieldName = "Intitule",
                Visible   = true
            });
            repo.View.OptionsView.ShowColumnHeaders = false;
            repo.View.OptionsView.ShowFooter        = false;
            repo.View.OptionsView.ShowIndicator     = false;
            repo.ShowFooter    = false;
            repo.PopupFormSize = new Size(200, 200);
            repo.NullText      = string.Empty;

            #region grid columns

            var colMatricule = new GridColumn
            {
                Caption   = @"Matricule",
                FieldName = "Matricule",
                Visible   = true,
                MinWidth  = 80,
                MaxWidth  = 120,
                ToolTip   = @"Matricule"
            };
            var colNumeroCnss = new GridColumn
            {
                Caption   = @"Numéro Cnss",
                FieldName = "NumCnss",
                Visible   = true,
                MinWidth  = 80,
                MaxWidth  = 80,
                ToolTip   = @"Numéro Cnss"
            };
            var colCleCnss = new GridColumn
            {
                Caption   = @"Clé",
                FieldName = "CleCnss",
                Visible   = true,
                MinWidth  = 40,
                MaxWidth  = 40,
                ToolTip   = @"Clé Cnss"
            };
            var colCivilite = new GridColumn
            {
                Caption    = @"Civilité",
                FieldName  = "Civilite",
                Visible    = true,
                MinWidth   = 80,
                MaxWidth   = 80,
                ToolTip    = @"Civilite",
                ColumnEdit = repoCivilite
            };
            var colCin = new GridColumn
            {
                Caption   = @"Cin",
                FieldName = "Cin",
                Visible   = true,
                MinWidth  = 80,
                MaxWidth  = 80,
                ToolTip   = @"Cin"
            };
            var colNom = new GridColumn
            {
                Caption   = @"Nom",
                FieldName = "Nom",
                Visible   = true,
                MinWidth  = 80,
                MaxWidth  = 160,
                ToolTip   = @"Nom"
            };
            var colPrenom = new GridColumn
            {
                Caption   = @"Prénom",
                FieldName = "Prenom",
                Visible   = true,
                MinWidth  = 80,
                MaxWidth  = 160,
                ToolTip   = @"Prenom"
            };
            var colAutresNom = new GridColumn
            {
                Caption   = @"Autres nom",
                FieldName = "AutreNom",
                Visible   = true,
                //MinWidth = 80,
                //MaxWidth = 80,
                ToolTip = @"Autres nom"
            };
            var colNomJeuneFille = new GridColumn
            {
                Caption   = @"Nom de jeune fille",
                FieldName = "NomJeuneFille",
                Visible   = true,
                MinWidth  = 20,
                MaxWidth  = 160,
                ToolTip   = @"Nom de jeune fille"
            };
            var colSituationFamille = new GridColumn
            {
                Caption    = @"Situation familiale",
                FieldName  = "SituationFamille",
                Visible    = true,
                MinWidth   = 80,
                MaxWidth   = 80,
                ToolTip    = @"Situation familiale",
                ColumnEdit = repoSituationFamille
            };
            colTypeCnss = new GridColumn
            {
                Caption    = @"Type Cnss",
                FieldName  = "TypeCnss",
                Visible    = true,
                MinWidth   = 80,
                MaxWidth   = 80,
                ToolTip    = @"Type Cnss",
                ColumnEdit = repo
            };
            var maskRepo = new RepositoryItemTextEdit();
            maskRepo.Mask.MaskType = MaskType.Numeric;
            maskRepo.Mask.EditMask = "N3";

            var colBrutAStr = new GridColumn
            {
                ColumnEdit = maskRepo,
                Caption    = @"Brut 1",
                FieldName  = "BrutA",
                Visible    = true,
                MinWidth   = 50,
                MaxWidth   = 80,
                ToolTip    = @"BrutA"
            };

            var colBrutBStr = new GridColumn
            {
                ColumnEdit = maskRepo,
                Caption    = @"Brut 2",
                FieldName  = "BrutB",
                Visible    = true,
                MinWidth   = 50,
                MaxWidth   = 80,
                ToolTip    = @"Brut 2"
            };

            var colBrutCStr = new GridColumn
            {
                ColumnEdit = maskRepo,
                Caption    = @"Brut 3",
                FieldName  = "BrutC",
                Visible    = true,
                MinWidth   = 50,
                MaxWidth   = 80,
                ToolTip    = @"Brut 3"
            };

            viewLigne.Columns.AddRange(new[]
            {
                colMatricule,
                colNumeroCnss,
                colCleCnss,
                colCivilite,
                colCin,
                colNom,
                colPrenom,
                colAutresNom,
                colNomJeuneFille,
                colSituationFamille,
                //colTypeCnss,
                colBrutAStr,
                colBrutBStr,
                colBrutCStr
            });

            #endregion grid columns

            #region grid options

            viewLigne.OptionsView.ShowAutoFilterRow            = true;
            viewLigne.OptionsCustomization.AllowColumnMoving   = false;
            viewLigne.OptionsCustomization.AllowColumnResizing = false;
            viewLigne.OptionsCustomization.AllowFilter         = false;
            // viewLigne.OptionsCustomization.AllowGroup = false;
            viewLigne.OptionsCustomization.AllowQuickHideColumns = false;
            viewLigne.OptionsCustomization.AllowSort             = false;
            viewLigne.OptionsMenu.EnableColumnMenu = false;
            viewLigne.FocusRectStyle = DrawFocusRectStyle.RowFullFocus;
            viewLigne.OptionsSelection.EnableAppearanceFocusedCell = true;
            viewLigne.OptionsDetail.EnableMasterViewMode           = false;
            viewLigne.Appearance.FocusedRow.BackColor             = Color.FromArgb(255, 255, 192);
            viewLigne.Appearance.SelectedRow.BackColor            = Color.FromArgb(255, 255, 192);
            viewLigne.Appearance.FocusedCell.BackColor            = Color.White;
            viewLigne.Appearance.FocusedCell.Options.UseBackColor = true;
            viewLigne.Appearance.OddRow.BackColor                 = Color.FromArgb(231, 244, 247);
            viewLigne.OptionsView.EnableAppearanceOddRow          = true;
            viewLigne.Appearance.SelectedRow.Options.UseBackColor = true;
            viewLigne.OptionsView.ShowGroupPanel = false;
            viewLigne.InvalidRowException       += ViewInvalidRowException;
            viewLigne.ValidateRow += gridLignes_ValidateRow;
            colBrutAStr.Summary.Add(SummaryItemType.Sum, "BrutA", "{0:0.000}");
            colBrutBStr.Summary.Add(SummaryItemType.Sum, "BrutB", "{0:0.000}");
            colBrutCStr.Summary.Add(SummaryItemType.Sum, "BrutC", "{0:0.000}");
            viewLigne.OptionsView.ShowFooter = true;
            viewLigne.FooterPanelHeight      = 35;
            //viewLigne.FocusedRowChanged += RowViewReglementFocusedChanged;

            #endregion grid options
        }