Esempio n. 1
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());
            }
        }
Esempio n. 2
0
        /// <summary>
        /// SetBestFitPopupSearchLookUpEdit
        /// </summary>
        /// <param name="searchLookUpEdit"></param>
        /// <param name="CheckBoxWidth"></param>
        public static void SetBestFitPopupSearchLookUpEdit(this SearchLookUpEdit searchLookUpEdit, int CheckBoxWidth = 0)
        {
            searchLookUpEdit.Properties.Popup += (sender, e) =>
            {
                try
                {
                    DevExpress.XtraEditors.SearchLookUpEdit currentLook = (DevExpress.XtraEditors.SearchLookUpEdit)sender;

                    currentLook.Properties.View.OptionsView.ColumnAutoWidth = false;
                    currentLook.Properties.View.BestFitColumns();

                    currentLook.Properties.View.HorzScrollVisibility = DevExpress.XtraGrid.Views.Base.ScrollVisibility.Never;

                    DevExpress.XtraEditors.Popup.PopupSearchLookUpEditForm currentPopup = (currentLook as DevExpress.Utils.Win.IPopupControl).PopupWindow as DevExpress.XtraEditors.Popup.PopupSearchLookUpEditForm;
                    //currentPopup.Size = new System.Drawing.Size(currentPopup.Width + 20, currentPopup.Height);
                    //currentPopup.Size = new System.Drawing.Size(slEdit.Width, currentPopup.Height);

                    int iColumnWidth = 0;
                    int iColCount    = currentLook.Properties.View.Columns.Count;
                    for (int i = 0; i < iColCount; i++)
                    {
                        if (currentLook.Properties.View.Columns[i].Visible == true)
                        {
                            iColumnWidth += currentLook.Properties.View.Columns[i].Width;
                        }
                    }

                    if (iColumnWidth > 0 && currentPopup.Size.Width < (iColumnWidth + 47 + CheckBoxWidth))
                    {
                        currentPopup.Size = new System.Drawing.Size(iColumnWidth + 47 + CheckBoxWidth, currentPopup.Height);
                    }
                }
                catch { }
            };
        }
Esempio n. 3
0
        public AppListInfo LinkListToColumn(TableBase.TableEnum listName, DevExpress.XtraEditors.SearchLookUpEdit col)
        {
            AppListInfo l = AppListStore.Find(x => x.AppListName == listName);

            l.LinkListToColumn(col);
            l.AddButtonsToList(col);
            return(l);
        }
Esempio n. 4
0
            public void LinkListToColumn(DevExpress.XtraEditors.SearchLookUpEdit col, string gridFilterString = "")
            {
                try
                {
                    DevExpress.XtraGrid.Views.Grid.GridView MyList = (DevExpress.XtraGrid.Views.Grid.GridView) this.LayoutObject;

                    col.Properties.DataSource    = this.ListBindingSource;
                    col.Properties.DisplayMember = this.DisplayMember;
                    col.Properties.ValueMember   = this.ValueMember;

                    RetrieveRows(false);
                    col.Properties.View.GridControl.ForceInitialize();
                    CopySettings(MyList, col.Properties.View);
                    if (gridFilterString != "")
                    {
                        col.Properties.View.ActiveFilterString = gridFilterString;
                    }
                }
                catch (Exception ex)
                {
                    XtraMessageBox.Show(GlobalMethods.FormateExceptionMessage(ex));
                }
            }
Esempio n. 5
0
        protected virtual void FormatControl(Control p_objControl)
        {
            if (p_objControl.GetType().ToString() == "VTNN.Lib.CustomDateEdit")
            {
                DevExpress.XtraEditors.DateEdit v_objDateEdit = (DevExpress.XtraEditors.DateEdit)p_objControl;
                v_objDateEdit.Format_VS1();
            }

            if (p_objControl.GetType().ToString() == "VTNN.Lib.CustomSpinEdit")
            {
                DevExpress.XtraEditors.SpinEdit v_objSpinEdit = (DevExpress.XtraEditors.SpinEdit)p_objControl;
                v_objSpinEdit.Format(0, false, true, true);
            }
            if (p_objControl.GetType().ToString() == "VTNN.Lib.CustomLookUpEdit")
            {
                DevExpress.XtraEditors.LookUpEdit v_objLookupEdit = (DevExpress.XtraEditors.LookUpEdit)p_objControl;
                v_objLookupEdit.Format(false);
            }
            if (p_objControl.GetType().ToString() == "VTNN.Lib.CustomSearchLookUpEdit")
            {
                DevExpress.XtraEditors.SearchLookUpEdit v_objSearchLookUpEdit = (DevExpress.XtraEditors.SearchLookUpEdit)p_objControl;
                v_objSearchLookUpEdit.Format(true);
            }
            if (p_objControl.GetType().ToString() == "VTNN.Lib.CustomGridControl")
            {
                DevExpress.XtraGrid.GridControl v_objGridControl = (DevExpress.XtraGrid.GridControl)p_objControl;
                Format_Grid(v_objGridControl);
            }

            if (p_objControl.Controls != null)
            {
                foreach (Control v_objCon in p_objControl.Controls)
                {
                    FormatControl(v_objCon);
                }
            }
        }
Esempio n. 6
0
        private void XRep05_ParametersRequestBeforeShow(object sender, ParametersRequestEventArgs e)
        {
            foreach (ParameterInfo info in e.ParametersInformation)
            {
                if (info.Parameter.Name == "pramPlumberId")
                {

                    DevExpress.XtraEditors.SearchLookUpEdit LUE = new DevExpress.XtraEditors.SearchLookUpEdit();

                    //XPSCSPlumber = new DevExpress.Xpo.XPServerCollectionSource
                    LUE.Properties.DataSource = PlumberbindingSource;
                    

                    LUE.Properties.DisplayMember = "PlumberName";
                    LUE.Properties.ValueMember = "PlumberId";

                    //LUE.Properties.Columns.Add(new LookUpColumnInfo("PlumberName", 0, "اسم السباك"));
                    //LUE.Properties.BestFit();
                    //LUE.Properties.NullText = string.Empty;
                    //LUE.Properties.TextEditStyle = TextEditStyles.Standard;

                    DevExpress.XtraGrid.Columns.GridColumn gridColumn1 = new DevExpress.XtraGrid.Columns.GridColumn();
                    DevExpress.XtraGrid.Columns.GridColumn gridColumn2 = new DevExpress.XtraGrid.Columns.GridColumn();
                    DevExpress.XtraGrid.Columns.GridColumn gridColumn3 = new DevExpress.XtraGrid.Columns.GridColumn();
                    DevExpress.XtraGrid.Columns.GridColumn gridColumn4 = new DevExpress.XtraGrid.Columns.GridColumn();
                    gridColumn1.Caption = "الاسم";
                    gridColumn1.FieldName = "PlumberName";
                    gridColumn1.Name = "gridColumn1";
                    gridColumn1.Visible = true;
                    gridColumn1.VisibleIndex = 0;
                    gridColumn2.Caption = "تليفون";
                    gridColumn2.FieldName = "PlumberPhone";
                    gridColumn2.Name = "gridColumn2";
                    gridColumn2.Visible = true;
                    gridColumn2.VisibleIndex = 1;
                    gridColumn3.Caption = "موبيل";
                    gridColumn3.FieldName = "PlumberMobile";
                    gridColumn3.Name = "gridColumn3";
                    gridColumn3.Visible = true;
                    gridColumn3.VisibleIndex = 2;
                    gridColumn4.Caption = "الرقم القومي";
                    gridColumn4.FieldName = "NationalId";
                    gridColumn4.Name = "gridColumn4";
                    gridColumn4.Visible = true;
                    gridColumn4.VisibleIndex = 3;

                    DevExpress.XtraGrid.Views.Grid.GridView searchLookUpEdit1View = new DevExpress.XtraGrid.Views.Grid.GridView();
                    searchLookUpEdit1View.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
                    gridColumn1,
                    gridColumn2,
                    gridColumn3,
                    gridColumn4});
                    searchLookUpEdit1View.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus;
                    searchLookUpEdit1View.Name = "searchLookUpEdit1View";
                    searchLookUpEdit1View.OptionsSelection.EnableAppearanceFocusedCell = false;
                    searchLookUpEdit1View.OptionsView.ShowAutoFilterRow = true;
                    searchLookUpEdit1View.OptionsView.ShowGroupPanel = false;

                    LUE.Properties.View = searchLookUpEdit1View;
                    
                    

                    LUE.EditValue = "";
                    LUE.Name = "LUE";
                    LUE.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo) });
                    LUE.Properties.DisplayMember = "PlumberName";
                    LUE.Properties.NullText = "";
                    LUE.Properties.ValueMember = "PlumberId";
                    //this.LUE.Properties.View = this.searchLookUpEdit1View;
                    LUE.Size = new System.Drawing.Size(182, 20);
                    LUE.TabIndex = 0;

                    info.Editor = LUE;
                    info.Parameter.Value = DBNull.Value;


                    
                    continue;
                }
            }
        }