Exemple #1
0
        //---------------------------------------------------------------------
        protected override void MyCreateControle(CCreateur2iFormulaireV2 createur, C2iWnd wnd, Control parent, IFournisseurProprietesDynamiques fournisseur)
        {
            C2iWndListeSpeedStandard listeStd = wnd as C2iWndListeSpeedStandard;

            if (listeStd == null)
            {
                return;
            }
            CCreateur2iFormulaireV2.AffecteProprietesCommunes(wnd, m_panelListeSpeedStd);
            m_fournisseurProprietes = fournisseur;
            m_panelListeSpeedStd.BoutonAjouterVisible                    = listeStd.HasAddButton;
            m_panelListeSpeedStd.BoutonSupprimerVisible                  = listeStd.HasDeleteButton;
            m_panelListeSpeedStd.BoutonModifierVisible                   = listeStd.HasDetailButton;
            m_panelListeSpeedStd.BoutonFiltrerVisible                    = listeStd.HasFilterButton;
            m_panelListeSpeedStd.AllowCustomisation                      = listeStd.UserCustomizable;
            m_panelListeSpeedStd.OnChangeSelection                      += new EventHandler(m_panelListeSpeedStd_OnChangeSelection);
            m_panelListeSpeedStd.AffectationsPourNouveauxElements        = listeStd.Affectations;
            m_panelListeSpeedStd.ObjetReferencePourAffectationsInitiales = EditedElement;
            if (listeStd.AlternativeEditedElement != null)
            {
                m_panelListeSpeedStd.TraiterModificationElement = TraiterEditionPanel;
            }
            // Initialisation des colonnes
            foreach (C2iWndListeSpeedStandard.CColonneListeSpeedStd col in WndListeStandard.Columns)
            {
                if (col.InfoChampDynamique != null)
                {
                    m_panelListeSpeedStd.AddColonne(col.Titre, col.InfoChampDynamique.NomPropriete, col.Width);
                }
                //string strCle = "";
                //string strProp = "";
                //if (!CDefinitionProprieteDynamique.DecomposeNomProprieteUnique(col.InfoChampDynamique.NomPropriete, ref strCle, ref strProp))
                //    strProp = col.InfoChampDynamique.Nom;
                //if(col.InfoChampDynamique != null)
                //    m_panelListeSpeedStd.AddColonne(col.Titre, strProp, col.Width);
            }
            // Initialise le filtre
            if (WndListeStandard.Filter != null)
            {
                CDbKey dbKeyFiltreStandard  = WndListeStandard.Filter.DbKey;
                CFiltreDynamiqueInDb filtre = new CFiltreDynamiqueInDb(CSc2iWin32DataClient.ContexteCourant);
                if (filtre.ReadIfExists(dbKeyFiltreStandard))
                {
                    m_panelListeSpeedStd.FiltrePrefere = filtre.Filtre;
                }
            }
            // Initialise le nom du controle pour le registre des colonnes
            string strNom = "CustomListeSpeedStandard_";

            if (WndListeStandard.SourceFormula != null)
            {
                strNom += WndListeStandard.SourceFormula.TypeDonnee.TypeDotNetNatif.ToString();
            }
            m_panelListeSpeedStd.Name = strNom;

            m_panelListeSpeedStd.UseCheckBoxes = WndListeStandard.UseCheckBoxes;


            parent.Controls.Add(m_panelListeSpeedStd);
        }