Exemple #1
0
 protected override object CreateControlCore()
 {
     lookup = new SearchLookUpEditEx();
     lookup.Properties.PopupFilterMode = PopupFilterMode.Contains;
     lookup.Properties.PopupFindMode = FindMode.Always;
     lookup.ToolTip = CaptionHelper.GetLocalizedText("Captions", "ExpandList");
     lookup.Properties.ShowClearButton = false;
     lookup.Properties.ShowAddNewButton = true;
     lookup.AddNewValue += (object sender, AddNewValueEventArgs args) =>
     {
         lookup.preventClose = false;
         if (lookup.searchFieldEmpty == true)
             return;
         AddNewObject();
     };
     lookup.ShowToolTips = true;
     //lookup.DataBindings.DefaultDataSourceUpdateMode = System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged;
     return lookup;
 }
Exemple #2
0
        private void properties_QueryPopUp(object sender, CancelEventArgs e)
        {
            if (lookup == null)
            {
                lookup = (SearchLookUpEditEx)sender;
            }
            lookup.Properties.BeginUpdate();

            XPCollection temp = (XPCollection)lookup.Properties.Helper.CreateCollectionSource(lookup.FindEditingObject()).ObjectSpace.CreateCollection(this.MemberInfo.MemberType);

            if (typeof(IDepartment).IsAssignableFrom(this.MemberInfo.MemberTypeInfo.Type))
            {
                temp.DisplayableProperties = "FacilityId;FacilityData";
            }

            if (typeof(IIdentifyCardType).IsAssignableFrom(this.MemberInfo.MemberTypeInfo.Type))
            {
                temp.DisplayableProperties = "DocumentName";
            }

            if (typeof(IInsurance).IsAssignableFrom(this.MemberInfo.MemberTypeInfo.Type))
            {
                temp.DisplayableProperties = "IsuranceName";
            }

            if (this.MemberInfo.MemberTypeInfo.Type == typeof(MitsarDataStudio.Module.BusinessObjects.EnumerationItem))
            {
                temp.DisplayableProperties = "Name";
            }

            if (this.MemberInfo.MemberTypeInfo.Type == typeof(MitsarDataStudio.Module.BusinessObjects.ExaminationType))
            {
                temp.DisplayableProperties = "Name";
            }

            lookup.Properties.View.ColumnChanged += delegate(object send, EventArgs args)
            {
                (send as DevExpress.XtraGrid.Columns.GridColumn).Caption = CaptionHelper.GetLocalizedText("CustomFomrsMessages", (send as DevExpress.XtraGrid.Columns.GridColumn).FieldName);

            };

            lookup.Properties.DataSource = temp;
            lookup.Properties.EndUpdate();
        }