Example #1
0
 void InitNullText(WebPropertyEditor propertyEditor)
 {
     if (propertyEditor.ViewEditMode == ViewEditMode.Edit)
     {
         ((ASPxDateEdit)propertyEditor.Editor).NullText = CaptionHelper.NullValueText;
     }
 }
Example #2
0
 private void InitNullText(WebPropertyEditor propertyEditor)
 {
     if (propertyEditor.ViewEditMode == DevExpress.ExpressApp.Editors.ViewEditMode.Edit)
     {
         ((ASPxDateEdit)propertyEditor.Editor).NullText = CaptionHelper.NullValueText;
     }
 }
        TableCell ContainerCell(WebPropertyEditor item)
        {
            var tableEx = ((TableEx)item.Control);

            if (tableEx == null)
            {
                return(null);
            }
            return(((TableRow)tableEx.Controls[0]).Cells[1]);
        }
Example #4
0
        protected override void CustomizeDisabledEditorsAppearance(ApplyAppearanceEventArgs e)
        {
            base.CustomizeDisabledEditorsAppearance(e);
            WebPropertyEditor dxEditor = e.Item as WebPropertyEditor;

            if (dxEditor != null && dxEditor.Editor != null)
            {
                dxEditor.Editor.BorderStyle = BorderStyle.Dashed;
                dxEditor.Editor.BackColor   = Color.RosyBrown;
            }
        }
Example #5
0
        IModelLayoutViewItemStyle ModelLayoutViewItem(WebPropertyEditor webPropertyEditor)
        {
            Guard.ArgumentNotNull(webPropertyEditor, "webPropertyEditor");

            if (View == null)
            {
                return((IModelLayoutViewItemStyle)webPropertyEditor.Model);
            }

            var modelDetailView = View.Model as IModelDetailView;

            return(modelDetailView == null ? (IModelLayoutViewItemStyle)webPropertyEditor.Model
                       : modelDetailView.Layout.ViewItems(webPropertyEditor.Model).Cast <IModelLayoutViewItemStyle>().FirstOrDefault());
        }
Example #6
0
        private void ConfigureAceEditor(WebPropertyEditor propertyEditor)
        {
            var aceEditorNeighborControl = GetAceEditorNeighborControl(propertyEditor);

            if (aceEditorNeighborControl != null)
            {
                var aceEditor      = new AceEditor();
                var literalControl = GetParentControlCollection(aceEditorNeighborControl, propertyEditor.ViewEditMode).OfType <Literal>().First();
                literalControl.Text = aceEditor.CreateContainer(aceEditorNeighborControl.ClientID, (string)propertyEditor.PropertyValue);
                var syntaxHighLight = ((IModelPropertyEditorSyntaxHighlight)propertyEditor.Model).SyntaxHighlight;
                var allowEdit       = View.ViewEditMode == ViewEditMode.Edit && propertyEditor.AllowEdit;
                aceEditor.Configure(aceEditorNeighborControl.ClientID, syntaxHighLight, allowEdit, (string)propertyEditor.PropertyValue);
            }
        }
Example #7
0
        void ApplyStyle(WebPropertyEditor webPropertyEditor)
        {
            var modelLayoutViewItem = ModelLayoutViewItem(webPropertyEditor);

            if (modelLayoutViewItem != null)
            {
                var containerCell = ContainerCell(webPropertyEditor);
                if (containerCell != null)
                {
                    _layoutStyleProvider.ApplyContainerCellStyle(containerCell, modelLayoutViewItem.LayoutStyle);
                    _layoutStyleProvider.ApplyControlStyle((WebControl)containerCell.Controls[0], modelLayoutViewItem.LayoutStyle);
                }
            }
        }
Example #8
0
        private void WebNullTextEditorController_Activated(object sender, EventArgs e)
        {
            WebPropertyEditor propertyEditor = ((DetailView)View).FindItem("Anniversary") as WebPropertyEditor;

            if (propertyEditor != null)
            {
                if (propertyEditor.Control != null)
                {
                    InitNullText(propertyEditor);
                }
                else
                {
                    propertyEditor.ControlCreated += new EventHandler <EventArgs>(propertyEditor_ControlCreated);
                }
            }
        }
Example #9
0
        protected override void OnActivated()
        {
            base.OnActivated();
            WebPropertyEditor propertyEditor = ((DetailView)View).FindItem("Anniversary") as WebPropertyEditor;

            if (propertyEditor != null)
            {
                if (propertyEditor.Control != null)
                {
                    InitNullText(propertyEditor);
                }
                else
                {
                    propertyEditor.ControlCreated += new EventHandler <EventArgs>(propertyEditor_ControlCreated);
                }
            }
        }
Example #10
0
        protected override void OnActivated()
        {
            base.OnActivated();
            // Perform various tasks depending on the target View.
            WebPropertyEditor propertyEditor = ((DetailView)View).FindItem("Anniversary") as WebPropertyEditor;

            if (propertyEditor != null)
            {
                if (propertyEditor.Control != null)
                {
                    InitNullText(propertyEditor);
                }
                else
                {
                    propertyEditor.ControlCreated += PropertyEditor_ControlCreated;
                }
            }
        }
Example #11
0
        protected override void OnViewControlsCreated()
        {
            base.OnViewControlsCreated();
            ASPxTreeListEditor editor = View.Editor as ASPxTreeListEditor;

            if (editor != null && View.Model.AllowEdit)
            {
                editor.TreeList.SettingsEditing.Mode           = DevExpress.Web.ASPxTreeList.TreeListEditMode.Inline;
                editor.TreeList.NodeUpdating                  += new DevExpress.Web.Data.ASPxDataUpdatingEventHandler(TreeList_NodeUpdating);
                editor.TreeList.CommandColumnButtonInitialize += new TreeListCommandColumnButtonEventHandler(TreeList_CommandColumnButtonInitialize);
                foreach (TreeListColumn column in editor.TreeList.Columns)
                {
                    if (column is TreeListDataColumn && ((TreeListDataColumn)column).EditCellTemplate != null)
                    {
                        WebPropertyEditor propertyEditor = ((EditModeDataItemTemplate)((TreeListDataColumn)column).EditCellTemplate).PropertyEditor;
                        propertyEditor.ControlCreated += new EventHandler <EventArgs>(propertyEditor_ControlCreated);
                    }
                }
            }
        }
        public static IEnumerable <ASPxWebControl> GetEditors(this WebPropertyEditor propertyEditor)
        {
            var lookupPropertyEditor = propertyEditor as ASPxLookupPropertyEditor;

            if (lookupPropertyEditor != null)
            {
                yield return(lookupPropertyEditor.DropDownEdit.DropDown);

                yield return(lookupPropertyEditor.FindEdit.Editor);

                yield break;
            }
            var searchLookupPropertyEditor = propertyEditor as ASPxSearchLookupPropertyEditor;

            if (searchLookupPropertyEditor != null)
            {
                yield return(searchLookupPropertyEditor.SearchDropDownEdit.DropDown);

                yield break;
            }
            yield return(propertyEditor.Editor as ASPxWebControl);
        }
Example #13
0
 public ASPxPropertyEditorUploadControlProvider(ASPxUploadControl asPxUploadControl, WebPropertyEditor webPropertyEditor)
 {
     _asPxUploadControl = asPxUploadControl;
     _webPropertyEditor = webPropertyEditor;
 }
Example #14
0
 private bool SyntaxHighlightEnabled(WebPropertyEditor propertyEditor)
 {
     return(!string.IsNullOrWhiteSpace(((IModelPropertyEditorSyntaxHighlight)propertyEditor.Model).SyntaxHighlight.Mode));
 }
Example #15
0
 private WebControl GetAceEditorNeighborControl(WebPropertyEditor webPropertyEditor)
 {
     return((WebControl)(View.ViewEditMode == ViewEditMode.Edit? webPropertyEditor.Editor:webPropertyEditor.Control));
 }
Example #16
0
        TableCell ContainerCell(WebPropertyEditor item)
        {
            var tableEx = (item.Control as TableEx);

            return(((TableRow)tableEx?.Controls[0])?.Cells[1]);
        }
 private void InitNullText(WebPropertyEditor propertyEditor) {
     if(propertyEditor.ViewEditMode == DevExpress.ExpressApp.Editors.ViewEditMode.Edit) {
         ((ASPxDateEdit)propertyEditor.Editor).NullText = CaptionHelper.NullValueText;
     }
 }