Exemple #1
0
        public void LinkListToColumn(DevExpress.XtraGrid.Columns.GridColumn col, Type tableType, string _valueMember = "", string gridFilterString = "")
        {
            XPClassInfo classInfo = AppListSession.GetClassInfo(tableType);

            DataMemberXPCollection = new XPCollection(AppListSession, classInfo);

            var lookupGrd     = new RepositoryItemSearchLookUpEdit();
            var lookupGrdView = new GridView();

            lookupGrd.BeginInit();
            lookupGrdView.BeginInit();
            SetupGridView(lookupGrdView, DataMemberXPCollection);
            lookupGrd.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
                new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)
            });
            lookupGrd.Name          = "lookupGrd";
            lookupGrd.View          = lookupGrdView;
            lookupGrd.DataSource    = DataMemberXPCollection;
            lookupGrd.DisplayMember = DisplayMember;
            lookupGrd.ValueMember   = string.IsNullOrEmpty(_valueMember) ? ValueMember : _valueMember;
            //if (_valueMember.IsNotNull()) lookupGrd.KeyMember = _valueMember;
            col.ColumnEdit = lookupGrd;

            ActiveColumnLinks.Add(col);
            RetrieveRows(false); //Tell AppList to get its rows if it the first use
        }
Exemple #2
0
        public void LinkListToColumn(DevExpress.XtraEditors.SearchLookUpEdit col, Type tableType, string gridFilterString = "")
        {
            try
            {
                XPClassInfo classInfo = AppListSession.GetClassInfo(tableType);
                DataMemberXPCollection = new XPCollection(AppListSession, classInfo);

                col.Properties.DataSource = this.DataMemberXPCollection;


                RetrieveRows(false);
                col.Properties.View.GridControl.ForceInitialize();

                SetupGridView(col.Properties.View, DataMemberXPCollection);
                col.Properties.ValueMember   = ValueMember;
                col.Properties.DisplayMember = DisplayMember;
                if (gridFilterString != "")
                {
                    col.Properties.View.ActiveFilterString = gridFilterString;
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.GetFullExceptionErrMessage());
            }
        }
Exemple #3
0
        public void LinkLookupsToGrid(CoreLib.Grid.MyGridView _gridView, Type _type)
        {
            XPClassInfo _classInfo = AppListSession.GetClassInfo(_type);

            LinkLookupsToGrid(_gridView, _classInfo);
        }