Change Span or Hide LayoutColumn in RadPageLayout

1 Answer 29 Views
Menu PageLayout
Jeff
Top achievements
Rank 2
Iron
Iron
Veteran
Jeff asked on 20 May 2021, 12:48 PM

In my login page, I would like to hide the RadMenu which resides in the Master page in a RadPageLayout column.

Currently, the LayoutColumn holding the RadMenu has a Span of "2".  The RadMenu is in a LayoutColumn with a Span of "10".  Both exist within the same LayoutRow. 

When I set the RadMenu.Visible property to "false", the parent LayoutColumn is still rendered and while the RadMenu is not visible, the space it occupies is.  This forces the login form to appear off-center.

I have implemented a crude padding-right value which makes the visible login form to appear to be centered.  This is not a desired approach.

Is it possible to hide this LayoutColumn, server-side, on the login page so that the form isn't off center, or maybe a better solution to achieve the desired functionality?

Thank you, in advance.

1 Answer, 1 is accepted

Sort by
0
Accepted
Jeff
Top achievements
Rank 2
Iron
Iron
Veteran
answered on 20 May 2021, 06:25 PM

This problem has been solved by simply assigning an ID to each of the columns, then grabbing each column in the code behind, setting the RadMenu column visibility to false, and setting the ContentColumn Span to 12 to occupy the entire viewport. 

The form is now centered on the screen.  Here's my code:

RadPageLayout myPageLayout = Page.Master.FindControl("RadPageLayoutMaster") as RadPageLayout;
var menuCol = myPageLayout.FindControl("MenuColumn") as LayoutColumn;
var contentCol = myPageLayout.FindControl("ContentColumn") as LayoutColumn;
menuCol.Visible = false;           
contentCol.Span = 12;

Tags
Menu PageLayout
Asked by
Jeff
Top achievements
Rank 2
Iron
Iron
Veteran
Answers by
Jeff
Top achievements
Rank 2
Iron
Iron
Veteran
Share this question
or