private void Form1_Load(object sender, EventArgs e)
        {
            IList dataSource = CreateDataSource();

            GridSplitContainer gridSplitContainer = new GridSplitContainer();

            gridSplitContainer.Parent   = this;
            gridSplitContainer.Location = new Point(0, 0);
            gridSplitContainer.Size     = new Size(350, 300);
            gridSplitContainer.Initialize();
            gridSplitContainer.SplitViewCreated += new EventHandler(gridSplitContainer_SplitViewCreated);

            // Customize the first grid control.
            GridControl grid = gridSplitContainer.Grid;
            GridView    view = grid.MainView as GridView;

            // Specify a data source.
            grid.DataSource = dataSource;
            // Resize columns according to their values.
            view.BestFitColumns();
            // Locate a row containing a specific value.
            view.FocusedRowHandle = view.LocateByValue("Country", "UK");

            // Display a splitter and second grid control.
            gridSplitContainer.ShowSplitView();

            // Customize the second grid control.
            GridControl secondGrid = gridSplitContainer.SplitChildGrid;
            GridView    secondView = secondGrid.MainView as GridView;

            // Locate a row containing a specific value.
            secondView.FocusedRowHandle = secondView.LocateByValue("Country", "Sweden");
        }
        private void gridSplitContainer_SplitViewCreated(object sender, EventArgs e)
        {
            // Display the Embedded Navigator for the second grid control
            // in the horizontally oriented Split View.
            GridSplitContainer gsc = sender as GridSplitContainer;

            if (!gsc.Horizontal)
            {
                gsc.SplitChildGrid.UseEmbeddedNavigator = true;
            }
        }
Пример #3
0
        public static bool IsGridSplitted(GridControl grid)
        {
            if (grid == null || !grid.IsSplitGrid)
            {
                return(false);
            }

            GridSplitContainer container = Utils.FindTypedParentControl <GridSplitContainer>(grid);

            if (container == null)
            {
                return(false);
            }

            return(container.IsSplitViewVisible);
        }