public static ICollection <PropertyEditor> GetPropertyEditors(this DetailView xpandDetailView, Type editorIsOfType) { IEnumerable <PropertyEditor> editors = from editor in xpandDetailView.GetItems <PropertyEditor>() where editor.Control != null && editorIsOfType.IsAssignableFrom(editor.Control.GetType()) select editor; return(editors.ToList()); }
private void OpenWith(DetailView detailView) { var propertyEditors = detailView.GetItems <PropertyEditor>(); foreach (var propertyEditor in propertyEditors) { propertyEditor.ControlCreated += PropertyEditorOnControlCreated; } }
private PivotGridCustomizationDetailViewItem FindPivotGridCustomizationItem() { DetailView view = (DetailView)View; IList <PivotGridCustomizationDetailViewItem> items = view.GetItems <PivotGridCustomizationDetailViewItem>(); if (items.Count != 0) { return(items[0]); } return(null); }
private Type GetChoiceType() { Type typeAnalysingObject = null; if (detailView == null) { return(typeAnalysingObject); } foreach (PropertyEditor item in detailView.GetItems <PropertyEditor>()) { if (item.PropertyName == "DataType") { typeAnalysingObject = item.PropertyValue as System.Type; break; } } return(typeAnalysingObject); }
protected override void OnActivated() { base.OnActivated(); DetailView curView = (DetailView)View; IList <ASPxLookupPropertyEditor> lstPropEditors = curView.GetItems <ASPxLookupPropertyEditor>(); if (lstPropEditors != null) { foreach (ASPxLookupPropertyEditor item in lstPropEditors) { item.ViewModeBehavior = ObjectPropertyEditorViewModeBehavior.ShowLabel; } } }
protected override void OnActivated() { base.OnActivated(); InitSearchObjectActionItems(); if (typeof(ISearchObject).IsAssignableFrom(View.ObjectTypeInfo.Type)) { DetailView dv = View as DetailView; if (dv != null) { foreach (ListPropertyEditor editor in dv.GetItems <ListPropertyEditor>()) { if (editor.PropertyName == SearchResultsCollectionName) { editor.ControlCreated += new EventHandler <EventArgs>(editor_ControlCreated); } } RefreshController refreshController = Frame.GetController <RefreshController>(); if (refreshController != null) { refreshController.RefreshAction.Active[ActiveKeySearchObject] = false; } RecordsNavigationController recordsNavigationController = Frame.GetController <RecordsNavigationController>(); if (recordsNavigationController != null) { recordsNavigationController.PreviousObjectAction.Active[ActiveKeySearchObject] = false; recordsNavigationController.NextObjectAction.Active[ActiveKeySearchObject] = false; } ModificationsController modificationsController = Frame.GetController <ModificationsController>(); if (modificationsController != null) { modificationsController.SaveAction.Active[ActiveKeySearchObject] = false; modificationsController.SaveAndCloseAction.Active[ActiveKeySearchObject] = false; modificationsController.CancelAction.Active[ActiveKeySearchObject] = false; } DeleteObjectsViewController deleteObjectsViewController = Frame.GetController <DeleteObjectsViewController>(); if (deleteObjectsViewController != null) { deleteObjectsViewController.DeleteAction.Active[ActiveKeySearchObject] = false; } NewObjectViewController newObjectViewController = Frame.GetController <NewObjectViewController>(); if (newObjectViewController != null) { newObjectViewController.NewObjectAction.Active[ActiveKeySearchObject] = false; } } SearchObjectAction.Active[ActiveKeySearchObject] = false; } }
protected override void OnActivated() { base.OnActivated(); // Perform various tasks depending on the target View. DetailView curView = (DetailView)View; //das View durchgehen und die Lookup Property editoren heraus suchen IList <ASPxLookupPropertyEditor> lstPropEditors = curView.GetItems <ASPxLookupPropertyEditor>(); if (lstPropEditors != null) { foreach (ASPxLookupPropertyEditor item in lstPropEditors) { item.ViewModeBehavior = ObjectPropertyEditorViewModeBehavior.ShowLabel; } } }
void View_ControlsCreating(object sender, EventArgs e) { DetailView detailView = (DetailView)View; foreach (PropertyEditor editor in detailView.GetItems <PropertyEditor>()) { Attribute attr = editor.MemberInfo.FindAttribute <RuleRequiredFieldAttribute>(); if (attr != null) { HighLightProperty(editor as DXPropertyEditor, true); } else { HighLightProperty(editor as DXPropertyEditor, false); } } }
protected override void OnDeactivated() { //View.ControlsCreated -= new EventHandler(View_ControlsCreated); DetailView detailView = (DetailView)View; foreach (PropertyEditor editor in detailView.GetItems <PropertyEditor>()) { Attribute attr = editor.MemberInfo.FindAttribute <RuleRequiredFieldAttribute>(); if (attr != null) { // Перехват LostFocus (отписка от) //((System.Windows.Forms.Control)editor.Control).LostFocus -= new EventHandler(FormField_LostFocus); //((System.Windows.Forms.Control)editor.Control).TextChanged -= new EventHandler(FormField_TextChanged); } } base.OnDeactivated(); }
private int GetFilterHight(DetailView detailView) { int height = -1; foreach (PropertyEditor editor in detailView.GetItems <PropertyEditor>()) { DXPropertyEditor dxEditor = editor as DXPropertyEditor; if (dxEditor == null) { continue; } //if (!dxEditor.Control.Visible) continue; int summa = dxEditor.Control.ClientSize.Height + dxEditor.Control.Location.Y; if (height < summa) { height = summa; // +dxEditor.Control.Bottom; } } return(height); }
public static PropertyEditor GetPropertyEditor(this DetailView detailView, string memberName) => detailView .GetItems <PropertyEditor>().First(editor => editor.MemberInfo.Name == memberName);
private void RecolorFields() { DetailView detailView = (DetailView)View; foreach (PropertyEditor editor in detailView.GetItems <PropertyEditor>()) { //if (!editor.AllowEdit) continue; // Исследование структуры редакторов элементов /* * DXPropertyEditor dxEditor = editor as DXPropertyEditor; * //object dvi = editor.Control; * if (dxEditor != null && dxEditor.Control != null) { * //Control.ControlCollection contrcol = dxEditor.Control.Controls; * dxEditor.Control.Properties.Appearance.BackColor = Color.FromArgb(215, 255, 255); * } */ Attribute attr = editor.MemberInfo.FindAttribute <RuleRequiredFieldAttribute>(); if (attr != null) { // Перехват LostFocus - отменён 2011-08-01 //((System.Windows.Forms.Control)editor.Control).LostFocus += new EventHandler(FormField_LostFocus); // Раскраска обязательных полей на форме (в пользовательской модели не запоминается) DXPropertyEditor dxEditor = editor as DXPropertyEditor; if (dxEditor.Control != null) { if (!editor.AllowEdit) { // SHU!!! 2011-09-07 Три строки, которые управляют украшениями dxEditor.Control.ForeColor = Color.FromArgb(0, 100, 0); dxEditor.Control.Properties.BorderStyle = BorderStyles.Default; dxEditor.Control.Properties.Appearance.BackColor = Color.FromArgb(245, 245, 245); } else { // SHU!!! 2011-09-07 Три строки, которые управляют украшениями dxEditor.Control.ForeColor = Color.FromArgb(0, 0, 0); dxEditor.Control.Properties.BorderStyle = BorderStyles.Office2003; dxEditor.Control.Properties.Appearance.BackColor = Color.FromArgb(255, 235, 245); } /* * // Добавляем атрибут для выделения заголовка поля - НЕ РАБОТАЕТ ПО НЕИЗВЕСТНЫМ ПРИЧИНАМ * // http://documentation.devexpress.com/#Xaf/CustomDocument3286 * // http://www.devexpress.com/Support/Center/p/Q298805.aspx * //XafTypesInfo.Instance.FindTypeInfo(typeof(PersistentObject1)).AddAttribute(new DevExpress.Persistent.Base.DefaultClassOptionsAttribute()); * //[Appearance("DisplaySummMode.Caption.Bold", AppearanceItemType.LayoutItem, "true", FontStyle = FontStyle.Bold)] * string AttrId = dxEditor.Id + ".Caption.Bold"; * AppearanceAttribute AppearAttr = new AppearanceAttribute(AttrId); * AppearAttr.AppearanceItemType = AppearanceItemType.LayoutItem.ToString(); * AppearAttr.BackColor = "Red"; * AppearAttr.FontColor = "Blue"; * AppearAttr.FontStyle = FontStyle.Bold; * AppearAttr.Criteria = "isnull(" + dxEditor.Id + ") OR not isnull(" + dxEditor.Id + ")"; * AppearAttr.TargetItems = dxEditor.Id; * dxEditor.MemberInfo.AddAttribute(AppearAttr); * dxEditor.Refresh(); * //editor.MemberInfo.AddAttribute(AppearAttr); * //editor.Refresh(); */ } } } }
private void ProdOrderP_View_ViewControlsCreated(object sender, EventArgs e) { detailView = (DetailView)View; prodOrderP = (ProdOrderP)detailView.CurrentObject; foreach (ControlDetailItem cdi in detailView.GetItems<ControlDetailItem>()) { switch (cdi.Id) { case "btnOK": btnOK = (SimpleButton)cdi.Control; btnOK.Text = "出單"; btnOK.Click += new EventHandler(btnOK_Click); break; case "btnClose": btnClose = (SimpleButton)cdi.Control; btnClose.Text = "取消"; btnClose.Click += new EventHandler(btnClose_Click); break; case "txtAvailQty": txtAvailQty = (TextEdit)cdi.Control; txtAvailQty.Enabled = false; break; case "txtDailyQty": txtDailyQty = (TextEdit)cdi.Control; txtDailyQty.Enabled = false; break; case "txtMachine": txtMachine = (TextEdit)cdi.Control; break; case "txtNeedQty": txtNeedQty = (SpinEdit)cdi.Control; break; case "txtPartName": txtPartName = (TextEdit)cdi.Control; txtPartName.Enabled = false; break; case "txtPartNo": txtPartNo = (TextEdit)cdi.Control; txtPartNo.Enabled = false; break; case "txtResName": txtResName = (TextEdit)cdi.Control; txtResName.Enabled = false; break; case "txtResNo": txtResNo = (TextEdit)cdi.Control; txtResNo.Enabled = false; break; case "txtLackQty": txtLackQty = (TextEdit)cdi.Control; txtLackQty.Enabled = false; break; case "cboWorkOper": cboWorkOper = (ComboBoxEdit)cdi.Control; cboWorkOper.SelectedValueChanged += new EventHandler(cboWorkOper_SelectedValueChanged); break; case "datNeedDate": datNeedDate = (DateEdit)cdi.Control; break; } } initComboBox(); }