Ejemplo n.º 1
0
        protected virtual void UpdateListViewColumnOptions()
        {
            ColumnsListEditor columnsListEditor = View.Editor as ColumnsListEditor;

            if (columnsListEditor != null)
            {
                foreach (ColumnWrapper columnWrapper in columnsListEditor.Columns)
                {
                    IModelListViewColumnOptions options = columnsListEditor.Model.Columns[columnWrapper.PropertyName] as IModelListViewColumnOptions;
                    if (options != null)
                    {
                        if (columnWrapper.AllowSortingChange && !options.AllowSort)
                        {
                            columnWrapper.AllowSortingChange = false;
                            columnWrapper.SortOrder          = DevExpress.Data.ColumnSortOrder.None;
                            columnWrapper.SortIndex          = -1;
                        }
                        if (columnWrapper.AllowGroupingChange && !options.AllowGroup)
                        {
                            columnWrapper.AllowGroupingChange = false;
                            columnWrapper.GroupIndex          = -1;
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
 protected GridViewModelSynchronizer(IColumnViewEditor columnViewEditor)
     : base((DevExpress.XtraGrid.Views.Grid.GridView)columnViewEditor.ColumnView, columnViewEditor.Model)
 {
     _columnsListEditor = (ColumnsListEditor)columnViewEditor;
     _columnsListEditor.ControlsCreated += ColumnsListEditorControlsCreated;
     _columnViewEditor = columnViewEditor;
 }
Ejemplo n.º 3
0
 protected override void OnViewControlsCreated() {
     base.OnViewControlsCreated();
     _gridListEditor = ((ListView)View).Editor as ColumnsListEditor;
     if (_gridListEditor != null) {
         GridView gridView = _gridListEditor.GridView();
         if (gridView != null) gridView.MouseDown += GridView_MouseDown;
     }
 }
Ejemplo n.º 4
0
 protected override void OnViewControlsCreated()
 {
     base.OnViewControlsCreated();
     _gridListEditor = ((ListView)View).Editor as ColumnsListEditor;
     if (_gridListEditor != null)
     {
         GridView gridView = _gridListEditor.GridView();
         if (gridView != null)
         {
             gridView.MouseDown += GridView_MouseDown;
         }
     }
 }
Ejemplo n.º 5
0
        public static DevExpress.XtraGrid.Views.Grid.GridView GridView(this ColumnsListEditor columnsListEditor)
        {
            var gridListEditor = columnsListEditor as GridListEditor;

            if (gridListEditor != null)
            {
                return((gridListEditor).GridView);
            }
            var columnViewEditor = columnsListEditor as IColumnViewEditor;

            if (columnViewEditor != null)
            {
                return(columnViewEditor.ColumnView as DevExpress.XtraGrid.Views.Grid.GridView);
            }
            return(null);
        }
Ejemplo n.º 6
0
        public static RepositoryEditorsFactory RepositoryFactory(this ColumnsListEditor columnsListEditor)
        {
            var gridListEditor = columnsListEditor as GridListEditor;

            if (gridListEditor != null)
            {
                return((gridListEditor).RepositoryFactory);
            }
            var columnViewEditor = columnsListEditor as IColumnViewEditor;

            if (columnViewEditor != null)
            {
                return(columnViewEditor.RepositoryFactory);
            }
            throw new NotImplementedException(columnsListEditor.GetType().ToString());
        }
Ejemplo n.º 7
0
 public IXafGridColumn CreateNew(ITypeInfo typeInfo, ColumnsListEditor editor) {
     return new AdvBandedGridColumn(typeInfo, (AdvBandedListEditor)editor);
 }
Ejemplo n.º 8
0
 public IXafGridColumn CreateNew(ITypeInfo typeInfo, ColumnsListEditor editor)
 {
     return(new AdvBandedGridColumn(typeInfo, (AdvBandedListEditor)editor));
 }
Ejemplo n.º 9
0
 public IXafGridColumn CreateNew(ITypeInfo typeInfo, ColumnsListEditor editor) {
     return new XpandXafLayoutColumn(typeInfo, (LayoutViewListEditorBase)editor);
 }
Ejemplo n.º 10
0
 public IXafGridColumn CreateNew(ITypeInfo typeInfo, ColumnsListEditor editor)
 {
     return(new XpandXafLayoutColumn(typeInfo, (LayoutViewListEditorBase)editor));
 }
Ejemplo n.º 11
0
 IXafGridColumn IXafGridColumn.CreateNew(ITypeInfo typeInfo, ColumnsListEditor editor) {
     return new XpandXafGridColumn(typeInfo, editor);
 }
Ejemplo n.º 12
0
 public XpandXafGridColumn(ITypeInfo typeInfo, ColumnsListEditor columnsListEditor) {
     _columnsListEditor = columnsListEditor;
     _typeInfo = typeInfo;
 }
Ejemplo n.º 13
0
 protected GridViewModelSynchronizer(GridListEditor columnViewEditor)
     : base(columnViewEditor.GridView, columnViewEditor.Model)
 {
     _columnsListEditor = columnViewEditor;
     _columnsListEditor.ControlsCreated += ColumnsListEditorControlsCreated;
 }
Ejemplo n.º 14
0
 IXafGridColumn IXafGridColumn.CreateNew(ITypeInfo typeInfo, ColumnsListEditor editor)
 {
     return(new XpandXafGridColumn(typeInfo, editor));
 }
Ejemplo n.º 15
0
 public XpandXafGridColumn(ITypeInfo typeInfo, ColumnsListEditor columnsListEditor)
 {
     _columnsListEditor = columnsListEditor;
     _typeInfo          = typeInfo;
 }
Ejemplo n.º 16
0
        protected override void OnViewControlsCreated()
        {
            base.OnViewControlsCreated();
            genCon = Frame.GetController <GenController>();
            ASPxGridView grid = ((ListView)this.View).Editor.Control as ASPxGridView;

            if (grid != null)
            {
                grid.DataBound += Grid_DataBound;
            }
            if (typeof(ClassDocument).IsAssignableFrom(View.ObjectTypeInfo.Type) ||
                typeof(ClassDocumentDetail).IsAssignableFrom(View.ObjectTypeInfo.Type) ||
                typeof(ClassStockTransferDocument).IsAssignableFrom(View.ObjectTypeInfo.Type) ||
                typeof(ClassStockTransferDocumentDetail).IsAssignableFrom(View.ObjectTypeInfo.Type)
                )
            {
                if (!genCon.GetCurrentUserViewPriceStatus())
                {
                    ColumnsListEditor listEditor = View.Editor as ColumnsListEditor;

                    if (listEditor != null)
                    {
                        foreach (ColumnWrapper column in listEditor.Columns)
                        {
                            if (!string.IsNullOrEmpty(column.Id))
                            {
                                IModelColumn mycol = View.Model.Columns[column.Id];
                                if (mycol != null)
                                {
                                    string temp = View.Model.Columns[column.Id].ModelMember.PropertyEditorType.Name;
                                    //IModelPropertyEditor prop = (IModelPropertyEditor)View.Model.Columns[column.Id].ModelMember.PropertyEditorType.GetType();
                                    IModelMemberShowInCustomizationForm modelMember = (IModelMemberShowInCustomizationForm)View.Model.Columns[column.Id].ModelMember;
                                    //if (temp == "MyDecPropertyEditorVP" || temp == "MyDouPropertyEditorVP")
                                    if (temp.Contains("PropertyEditorVP"))
                                    {
                                        column.ShowInCustomizationForm = false;
                                    }
                                    else
                                    {
                                        column.ShowInCustomizationForm = modelMember.ShowInCustomizationForm;
                                    }

                                    //switch (column.Id)
                                    //{
                                    //    case "UnitPrice":
                                    //    case "LineTotal":
                                    //    case "TotalBeforeDiscount":
                                    //    case "Discount":
                                    //    case "TripCost":
                                    //    case "GST":
                                    //    case "GrandTotal":
                                    //        column.ShowInCustomizationForm = false;
                                    //        break;
                                    //    default:
                                    //        column.ShowInCustomizationForm = modelMember.ShowInCustomizationForm;
                                    //        break;
                                    //}
                                }
                            }
                        }
                    }
                }
            }
        }