Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Dock > Show / Hide Functionality

Not answered Show / Hide Functionality

Feed from this thread
  • Peter Johnson avatar

    Posted on Nov 21, 2011 (permalink)

    Hi,

    We are currently migrating one of our custom forms over to utilizing the RadDock.

    The current functionality provides the ability for 3 grids stacked on top of one another to trigger the parent panels to show / hide i.e. show 3 grids then swap to showing one grid in the full space provided.

    Is there a mechanism / utility methods within the dock panels / dock panel manager / splitter controls to achieve these capabilities?

    This is a representation of the functionality:

    Grid 1
    Grid 2
    Grid 3

    Click Full View

    Grid 1
    Grid 1
    Grid 1

    Click View All

    Grid 1
    Grid 2
    Grid 3

    We have access to the grids and have allowed them to publish their current state e.g. Collapsed / Expanded on click of the button, this occurs via a .Net event and delegate method.

    Thanks
    Pete

    Reply

  • Alexander Alexander admin's avatar

    Posted on Nov 24, 2011 (permalink)

    Hello Peter,

    Thank you for your question.

    You can add each of your RadGridView controls to a separate DocumentWindow, dock the first DocumentWindow to 'Top' and each other window to 'Top' anchored to the previous one:
    private DocumentWindow window1;
    private DocumentWindow window2;
    private DocumentWindow window3;
     
    this.window1 = new DocumentWindow("Window1");
    this.window1.CloseAction = DockWindowCloseAction.Hide;
    // Add the first RadGridView control to the window1's Controls collection.
     
    this.window2 = new DocumentWindow("Window2");
    this.window2.CloseAction = DockWindowCloseAction.Hide;
    // Add the second RadGridView control to the window2's Controls collection.
     
    this.window3 = new DocumentWindow("Window3");
    this.window3.CloseAction = DockWindowCloseAction.Hide;
    // Add the third RadGridView control to the window3's Controls collection.
     
    this.radDock1.DockWindow(this.window1, DockPosition.Top);
    this.radDock1.DockWindow(this.window2, this.window1, DockPosition.Top);
    this.radDock1.DockWindow(this.window3, this.window2, DockPosition.Top);

    The CloseAction of the windows from the above code snippet defines that they will be hidden (and not closed) when their state is changed to 'Hidden'.

    You can hide two of the windows and provide the space to the other one setting their DockState to 'Hidden':
    this.window2.DockState = DockState.Hidden;
    this.window3.DockState = DockState.Hidden;

    You can show the hidden windows in their previous places using:
    this.radDock1.DockWindow(this.window2, this.window1, DockPosition.Top);
    this.radDock1.DockWindow(this.window3, this.window2, DockPosition.Top);

    Please let us know if it helps in your scenario.

    Best regards,
    Alexander
    the Telerik team

    Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Dock > Show / Hide Functionality
Related resources for "Show / Hide Functionality"

[ Features | Demos | Documentation | Knowledge Base | Telerik TV | Code Library | Step-by-step Tutorial | Blogs | Self-Paced Trainer ]