Esempio n. 1
0
        public static void InitDefaultRepositoryGridLookUpEdit(String strTableName, ABCRepositoryGridLookupEdit repo, Boolean isCreateNewView)
        {
            ABCGridView view;

            if (isCreateNewView)
            {
                view = new ABCGridView(strTableName);
                InitDefaultColumns(strTableName, view);
            }
            else
            {
                view = GetDefaultGridView(strTableName);
            }

            repo.View        = view;
            repo.ValueMember = DataStructureProvider.GetPrimaryKeyColumn(strTableName);

            String strDisplayCol = DataStructureProvider.GetDisplayColumn(strTableName);

            if (String.IsNullOrWhiteSpace(strDisplayCol))
            {
                strDisplayCol = repo.ValueMember;
            }
            repo.DisplayMember = strDisplayCol;

            if (view.Columns.Count <= 7)
            {
                repo.BestFitMode = DevExpress.XtraEditors.Controls.BestFitMode.BestFitResizePopup;
            }
            else
            {
                repo.BestFitMode   = DevExpress.XtraEditors.Controls.BestFitMode.BestFit;
                repo.PopupFormSize = new System.Drawing.Size(700, 400);
            }
        }
Esempio n. 2
0
        public static RepositoryItemLookUpEditBase GetDefaultRepository(String strTableName, bool isCreateNew)
        {
            ABCRepositoryGridLookupEdit gridLookupEdit = GetDefaultRepositoryGridLookupEdit(strTableName, isCreateNew);

            if (gridLookupEdit.View.Columns.Count <= 2)
            {
                return(GetDefaultRepositoryLookUpEdit(strTableName, isCreateNew));
            }

            return(gridLookupEdit);
        }
Esempio n. 3
0
 public override void Assign(RepositoryItem item)
 {
     BeginUpdate();
     try
     {
         base.Assign(item);
         ABCRepositoryGridLookupEdit source = item as ABCRepositoryGridLookupEdit;
         if (source == null)
         {
             return;
         }
         _OwnerGridView = source.OwnerGridView;
     }
     finally
     {
         EndUpdate();
     }
 }
Esempio n. 4
0
        public static ABCRepositoryGridLookupEdit GetDefaultRepositoryGridLookupEdit(String strTableName, bool isCreateNew)
        {
            ABCRepositoryGridLookupEdit repo;

            if (isCreateNew)
            {
                repo = new ABCRepositoryGridLookupEdit();
                InitDefaultRepositoryGridLookUpEdit(strTableName, repo, false);
                return(repo);
            }

            if (ReposityGridLookupEdits.TryGetValue(strTableName, out repo))
            {
                return(repo);
            }

            repo = new ABCRepositoryGridLookupEdit();
            InitDefaultRepositoryGridLookUpEdit(strTableName, repo, false);
            ReposityGridLookupEdits.Add(strTableName, repo);
            return(repo);
        }
Esempio n. 5
0
 static ABCGridLookUpEdit( )
 {
     ABCRepositoryGridLookupEdit.RegisterCustomEdit();
 }