Example #1
1
 ASPxCallbackPanel CreateSplitterDetailPane(ASPxSplitter splitter) {
     SplitterPane detailPane = splitter.Panes.Add();
     detailPane.ScrollBars = ScrollBars.Auto;
     var updatePanel = new ASPxCallbackPanel { ID = "DetailUpdatePanel", ClientIDMode = ClientIDMode.Static };
     updatePanel.ClientSideEvents.Init = "function (s,e) {s.GetMainElement().ClientControl = s;}";
     detailPane.Controls.Add(updatePanel);
     return updatePanel;
 }
Example #2
0
    protected void nb_ItemClick(object source, DevExpress.Web.ASPxNavBar.NavBarItemEventArgs e)
    {
        ASPxNavBar   navbar     = source as ASPxNavBar;
        ASPxLabel    lbl        = Page.FindControl("lbl") as ASPxLabel;
        ASPxSplitter splitter   = Page.FindControl("splitter") as ASPxSplitter;
        UserControl  topgrid    = splitter.FindControl("cbpTop").FindControl("topgrid") as UserControl;
        UserControl  bottomgrid = splitter.FindControl("cbpBottom").FindControl("bottomgrid") as UserControl;

        ASPxGridView grid1 = null,
                     grid2 = null;

        if (topgrid != null)
        {
            grid1 = topgrid.FindControl("grid1") as ASPxGridView;
        }
        if (bottomgrid != null)
        {
            grid2 = bottomgrid.FindControl("grid2") as ASPxGridView;
        }

        if (e.Item.Name == "itm32")
        {
            StringBuilder result = new StringBuilder();
            if (grid1 != null)
            {
                result.AppendFormat("grid1 exists, current page is {0}", grid1.PageIndex + 1);
            }
            if (grid2 != null)
            {
                Object[] values = (Object[])grid2.GetRowValues(grid2.VisibleStartIndex + 1, new String[] { "Id", "Name", "Text" });
                result.AppendFormat("<br />grid2 exists, the second visible row values are <span style=\"Color: Red;\">{0}, {1}, {2}</span>", values[0], values[1], values[2]);
            }
            lbl.Text = result.ToString();
        }
    }
Example #3
0
        public override object LayoutControls(IModelNode layoutInfo, ViewItemsCollection detailViewItems)
        {
            var splitLayout = layoutInfo as IModelSplitLayout;

            if (IsMasterDetail(layoutInfo, detailViewItems, splitLayout))
            {
                _detailViewItems = detailViewItems;

                IListControlAdapter adapter = GetListControlAdapter((Control)detailViewItems[0].Control);
                if (adapter != null)
                {
                    var          detailControl = (Control)detailViewItems[1].Control;
                    ASPxSplitter splitter      = LayoutMasterDetail(detailControl, adapter, splitLayout);
                    var          viewItem      = detailViewItems[0] as ListEditorViewItem;

                    var listEditor = viewItem?.ListEditor as IXpandListEditor;
                    if (listEditor != null)
                    {
                        listEditor.ViewControlsCreated += (s, e) => SetSplitterInitClientEvent(splitter, e.IsRoot);
                    }

                    RaiseMasterDetailLayout(new MasterDetailLayoutEventArgs {
                        MasterViewItem  = detailViewItems[0],
                        DetailViewItem  = detailViewItems[1],
                        SplitterControl = splitter
                    });

                    return(splitter);
                }
                throw new NotImplementedException(detailViewItems[0].Control.ToString());
            }
            return(base.LayoutControls(layoutInfo, detailViewItems));
        }
Example #4
0
        SplitterPane CreateSplitterListPane(ASPxSplitter splitter)
        {
            SplitterPane listPane = splitter.Panes.Add();

            listPane.Name = "listPane";
            return(listPane);
        }
Example #5
0
 ASPxCallbackPanel CreateSplitterDetailPane(ASPxSplitter splitter) {
     SplitterPane detailPane = splitter.Panes.Add();
     detailPane.ScrollBars = ScrollBars.Auto;
     var updatePanel = new ASPxCallbackPanel { ID = "DetailUpdatePanel", ClientInstanceName = "DetailUpdatePanel" };
     updatePanel.ClientSideEvents.Init = GetAdjustSizeScript();
     updatePanel.ClientSideEvents.EndCallback = "function(s,e) {ProcessMarkup(s, true);}";
     updatePanel.CustomJSProperties += updatePanel_CustomJSProperties;
     detailPane.Controls.Add(updatePanel);
     return updatePanel;
 }
Example #6
0
        ASPxSplitter LayoutMasterDetail(Control detailControl, IListControlAdapter adapter, IModelSplitLayout splitLayout)
        {
            ASPxSplitter splitter = CreateSplitter(splitLayout, adapter);
            var          listPane = CreateSplitterListPane(splitter);

            listPane.Controls.Add(adapter.Control);

            var callbackPanel = CreateSplitterDetailPane(splitter);

            callbackPanel.Controls.Add(detailControl);
            return(splitter);
        }
Example #7
0
 ASPxSplitter CreateAsPxSplitter(IModelSplitLayout splitLayout, string paneResize) {
     var splitter = new ASPxSplitter {
         ID = "MasterDetailSplitter",
         ClientIDMode = ClientIDMode.Static,
         Orientation = (splitLayout.Direction == FlowDirection.Horizontal) ? Orientation.Horizontal : Orientation.Vertical,
         ShowCollapseBackwardButton = true,
         ShowCollapseForwardButton = true
     };
     splitter.ClientSideEvents.Init = "function (s,e) {s.AdjustControl(); s.GetMainElement().ClientControl = s;}";
     splitter.ClientSideEvents.PaneResized = paneResize;
     return splitter;
 }
Example #8
0
        private ASPxSplitter CreateSplitter(IModelSplitLayout splitLayout, IListControlAdapter adapter)
        {
            var splitter = new ASPxSplitter {
                ID          = "MasterDetailSplitter",
                Orientation =
                    (splitLayout.Direction == FlowDirection.Horizontal)
                        ? Orientation.Horizontal
                        : Orientation.Vertical,
                ShowCollapseBackwardButton = true,
                ShowCollapseForwardButton  = true
            };

            splitter.ClientSideEvents.PaneResized = GetPaneResizedEventScript(adapter);
            return(splitter);
        }
Example #9
0
        ASPxCallbackPanel CreateSplitterDetailPane(ASPxSplitter splitter)
        {
            SplitterPane detailPane = splitter.Panes.Add();

            detailPane.ScrollBars = ScrollBars.Auto;
            var updatePanel = new ASPxCallbackPanel {
                ID = "DetailUpdatePanel", ClientInstanceName = "DetailUpdatePanel"
            };

            if (!(WebWindow.CurrentRequestWindow is PopupWindow))
            {
                updatePanel.ClientSideEvents.Init = GetAdjustSizeScript();
            }


            updatePanel.ClientSideEvents.EndCallback = "function(s,e) {ProcessMarkup(s, true);}";
            updatePanel.CustomJSProperties          += updatePanel_CustomJSProperties;
            detailPane.Controls.Add(updatePanel);
            return(updatePanel);
        }
Example #10
0
 private static void SetSplitterInitClientEvent(ASPxSplitter splitter, bool isRoot)
 {
     if (WebApplicationStyleManager.IsNewStyle)
     {
         splitter.ClientSideEvents.Init = @"function(s,e) { 
             window.xafHeightAdjuster = { 
                 splitter: s,
                 oldAdjuster: window.xafHeightAdjuster,
                 Adjust: function () {
                     this.oldAdjuster.Adjust(); 
                     if (s.GetMainElement()) s.SetHeight(parseInt(document.getElementById('mainDiv').style['min-height']));} }
         
         window.RefreshUI(); }";
     }
     else
     {
         //
         splitter.ClientSideEvents.Init = string.Format(CultureInfo.InvariantCulture,
                                                        "function (s,e) {{ {0}  s.AdjustControl(); s.GetMainElement().ClientControl = s;}}", isRoot ? "window.MasterDetailSplitter = s;" : string.Empty);
     }
 }
Example #11
0
 private static void SetSplitterInitClientEvent(ASPxSplitter splitter, bool isRoot) {
     splitter.ClientSideEvents.Init = string.Format(CultureInfo.InvariantCulture,
         "function (s,e) {{ {0}  s.AdjustControl(); s.GetMainElement().ClientControl = s;}}", isRoot ? "window.MasterDetailSplitter = s;" : string.Empty);
 }
Example #12
0
        ASPxSplitter CreateSplitter(IModelSplitLayout splitLayout, string paneResize) {
            var splitter = new ASPxSplitter {
                ID = "MasterDetailSplitter",
                Orientation = (splitLayout.Direction == FlowDirection.Horizontal) ? Orientation.Horizontal : Orientation.Vertical,
                ShowCollapseBackwardButton = true,
                ShowCollapseForwardButton = true
            };

            splitter.ClientSideEvents.PaneResized = paneResize;
            return splitter;
        }
Example #13
0
 SplitterPane CreateSplitterListPane(ASPxSplitter splitter) {
     SplitterPane listPane = splitter.Panes.Add();
     listPane.Name = "listPane";
     return listPane;
 }
Example #14
0
        private ASPxSplitter CreateSplitter(IModelSplitLayout splitLayout, IListControlAdapter adapter) {
            var splitter = new ASPxSplitter {
                ID = "MasterDetailSplitter",
                Orientation =
                    (splitLayout.Direction == FlowDirection.Horizontal)
                        ? Orientation.Horizontal
                        : Orientation.Vertical,
                ShowCollapseBackwardButton = true,
                ShowCollapseForwardButton = true
            };

            splitter.ClientSideEvents.PaneResized = GetPaneResizedEventScript(adapter);
            return splitter;
        }
Example #15
0
 private static void SetSplitterInitClientEvent(ASPxSplitter splitter, bool isRoot)
 {
     splitter.ClientSideEvents.Init = string.Format(CultureInfo.InvariantCulture,
                                                    "function (s,e) {{ {0}  s.AdjustControl(); s.GetMainElement().ClientControl = s;}}", isRoot ? "window.MasterDetailSplitter = s;" : string.Empty);
 }