Exemplo n.º 1
0
        public void ModifyInstanceGridView(XpandXafGridView masterGridView, int rowHandle, int relationIndex, IModelListView masterModelListView, List<IMasterDetailRule> masterDetailRules) {
            var modelDetailRelationCalculator = new ModelDetailRelationCalculator(masterModelListView, masterGridView, masterDetailRules);
            bool isRelationSet = modelDetailRelationCalculator.IsRelationSet(rowHandle, relationIndex);
            if (isRelationSet) {
                IModelListView childModelListView = modelDetailRelationCalculator.GetChildModelListView(rowHandle, relationIndex);
                Window window = _xafApplication.CreateWindow(TemplateContext.View, null, true, false);
                ListView listView = GetListView(modelDetailRelationCalculator, rowHandle, relationIndex, childModelListView);
                var detailXafGridView = (XpandXafGridView)masterGridView.GetDetailView(rowHandle, relationIndex);
                ((XpandGridListEditor)listView.Editor).CustomGridViewCreate +=
                    (o, eventArgs) => {
                        eventArgs.Handled = true;
                        eventArgs.GridView = detailXafGridView;
                        eventArgs.GridControl.DataSource = detailXafGridView.DataSource;
                    };

                EventHandler[] listViewOnControlsCreated = { null };
                listViewOnControlsCreated[0] = (sender, args) => {
                    detailXafGridView.MasterFrame = masterGridView.MasterFrame ?? _masterFrame;
                    detailXafGridView.Window = window;
                    detailXafGridView.GridControl = masterGridView.GridControl;
                    listView.ControlsCreated -= listViewOnControlsCreated[0];
                };
                listView.ControlsCreated += listViewOnControlsCreated[0];
                ((PropertyCollectionSource)listView.CollectionSource).MasterObject = masterGridView.GetRow(rowHandle);
                window.SetView(listView);
            }
        }
Exemplo n.º 2
0
 protected override BaseView CreateInstance()
 {
     var view = new XpandXafGridView(_gridListEditor);
     view.SetGridControl(GridControl);
     OnInstanceCreated(new GridViewInstanceCreatedArgs(view));
     return view;
 }
Exemplo n.º 3
0
        protected override BaseView CreateInstance()
        {
            var view = new XpandXafGridView(_gridListEditor);

            view.SetGridControl(GridControl);
            OnInstanceCreated(new GridViewInstanceCreatedArgs(view));
            return(view);
        }
Exemplo n.º 4
0
 XpandXafGridView GetLevelDefaultViewCore(IModelListView masterModelListView, XpandXafGridView masterGridView, int rowHandle, int relationIndex, List<IMasterDetailRule> masterDetailRules) {
     var modelDetailRelationCalculator = new ModelDetailRelationCalculator(masterModelListView, masterGridView, masterDetailRules);
     bool isRelationSet = modelDetailRelationCalculator.IsRelationSet(rowHandle, relationIndex);
     if (isRelationSet) {
         IModelListView childModelListView = modelDetailRelationCalculator.GetChildModelListView(rowHandle, relationIndex);
         ListView listView = GetListView(modelDetailRelationCalculator, rowHandle, relationIndex, childModelListView);
         XpandXafGridView defaultXpandXafGridView = null;
         EventHandler[] listViewOnControlsCreated = { null };
         listViewOnControlsCreated[0] = (sender, args) => {
             defaultXpandXafGridView = (XpandXafGridView)((GridListEditor)((XpandListView)sender).Editor).GridView;
             listView.ControlsCreated -= listViewOnControlsCreated[0];
         };
         listView.ControlsCreated += listViewOnControlsCreated[0];
         listView.CreateControls();
         return defaultXpandXafGridView;
     }
     return null;
 }
Exemplo n.º 5
0
 public XpandXafGridView GetLevelDefaultView(XpandXafGridView masterGridView, int rowHandle, int relationIndex, IModelListView masterModelListView, List<IMasterDetailRule> masterDetailRules) {
     return GetLevelDefaultViewCore(masterModelListView, masterGridView, rowHandle, relationIndex, masterDetailRules);
 }
Exemplo n.º 6
0
 public GridViewInstanceCreatedArgs(XpandXafGridView xpandXafGridView)
 {
     _xpandXafGridView = xpandXafGridView;
 }
Exemplo n.º 7
0
 protected override BaseView CreateInstance() {
     var view = new XpandXafGridView(_gridListEditor);
     view.SetGridControl(GridControl);
     return view;
 }
Exemplo n.º 8
0
 public GridViewInstanceCreatedArgs(XpandXafGridView xpandXafGridView) {
     _xpandXafGridView = xpandXafGridView;
 }