This is a migrated thread and some comments may be shown as answers.

Show / Hide Functionality

1 Answer 232 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Peter Johnson
Top achievements
Rank 1
Peter Johnson asked on 21 Nov 2011, 06:42 PM
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

1 Answer, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 24 Nov 2011, 10:41 AM
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.

Tags
Dock
Asked by
Peter Johnson
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Share this question
or