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

Control Docking

6 Answers 210 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Fabrizio Berardi
Top achievements
Rank 1
Fabrizio Berardi asked on 04 Jun 2009, 01:24 PM
Hi,

I have a RadPanel with two controls on it, one is a RadGrid, the other is a Panel with some other controls on, which is made visible or invisible by the user.

I would like the RadGrid to fill the available space in the RadPanel, i.e to fill the whole panel when the other control is hidden or fill up to the other control when it is visible.  Currently when I set the GridView.Dock to Fill it fills the whole panel and other control is on top of it.

I am sure there is a simple way or property setting to sort this, could someone let me know asap as I am trying to finish this today.

Kind regards

6 Answers, 1 is accepted

Sort by
0
erwin
Top achievements
Rank 1
Veteran
answered on 04 Jun 2009, 10:02 PM
I would suggest placing the two controls in a standard .net TableLayoutPanel control that sits on top of the RadPanel. Configure the TableLayoutPanel to be transparent and to Dock/Fill the RadPanel. Configure the Table for 2 rows and 1 colunmn.
Place the grid in one row and the Panel in the other. Now configure the row with the panel in it to AutoSize.
Configure the Grid to Dock/Fill the entire other row.

Now you should have the desired behaviour, if you resize the RadPanel, its contents should resize as desired. Depending on your needs, you might want the contained RadPanel to Dock to the bottom of its containing TableLayoutPanel row.

You will have to fiddle a little bit with the BackgroundColor settings and Margin/Padding settings. Having the gradient of the RadPanel shine through several layers of transparent controls seems to slow down the painting of the controls considerably.

Regards
Erwin
0
Jack
Telerik team
answered on 05 Jun 2009, 09:16 AM
Erwin, thank you for this advise. You could use a simple Panel control or a Splitter instead of TableLayoutPanel. It depends on your application though.

Fabrizio, if you need further assistance please write us back. We will be glad to assist you.

All the best,
Jack
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Fabrizio Berardi
Top achievements
Rank 1
answered on 09 Jun 2009, 10:21 AM
Hi Jack,

Could you explain how I can use the Panel or splitter controls as we are using Theming and using a standard .net control as Erwin suggests will not work ?

Are you suggesting that each control goes into a panel and when these a set to Dock = Fill they do not overlay or underlay other panels on the same form / panel ?

Thanks.

0
erwin
Top achievements
Rank 1
Veteran
answered on 09 Jun 2009, 02:16 PM
Hi Fabrizio,
a TableLayoutPanel set to transparent should not interfere with your theming of the RadPanel below it.
Erwin
0
Prad
Top achievements
Rank 2
answered on 09 Jun 2009, 09:30 PM
I believe a simpler way is as follows:


1. Panel Main -  Drop MainPanel. Set MainPanel.Dock = FIll
 2.  - RightPanel Contails your controls. Set RightPanel.Dock = Right/Left/Top/Bottom (Whatever).
  3.   LeftPanel Contains Grid. Set LeftPanel.Dock = Fill; Grid.Dock = fill
 
In the runtime when you set RightPanel.Visible = false. You should be all good to LeftPanel with Grid....

Note: Follow the above steps while droping panels.

Jack view  of having Splitter is also a good way of going about.


Pradeep
0
Jack
Telerik team
answered on 10 Jun 2009, 09:38 AM
Hi Fabrizio,

Just follow the instructions from Pradeep. If you continue to have troubles with this, please send me your application. I will look at it and will try to find the best option.

I am looking forward to your reply.

Greetings,
Jack
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
GridView
Asked by
Fabrizio Berardi
Top achievements
Rank 1
Answers by
erwin
Top achievements
Rank 1
Veteran
Jack
Telerik team
Fabrizio Berardi
Top achievements
Rank 1
Prad
Top achievements
Rank 2
Share this question
or