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

Multi-Column Menu Not Breaking Correctly

3 Answers 25 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Bill
Top achievements
Rank 1
Bill asked on 19 Sep 2014, 02:19 PM
I have implemented a RadMenu with everything being handled in the code behind.  I am trying to dynamically set the number of columns based on the total number of menu items (nodes and child nodes).  I am doing something like this:

// determine column count
int rowsPerColumn = 15; // [TODO] Add value to site meta data to allow adjusting length per site
int columnCount = (int)Math.Ceiling(((double)_menuItemCount / (double)rowsPerColumn));
rootLevelSetting.ListLayout.RepeatColumns = columnCount;

The value for _menuItemCount is being updated during the PopulateSiteMap function.  That is working fine.  And, so is the assigning of the column count.  For one of my menu items, I am getting a long first column and short second and third columns.  Three columns should work fine.  I have attached some images for review.  Ideally, the second column should start with the External category.

Any help would be appreciated!
Bill
Telerik.Web.UI v2013.1.220.40 (I know we are behind a bit -- working on that :) )

3 Answers, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 24 Sep 2014, 08:23 AM
Hello Bill,

First I would like to explain a bit about the RepeatColumns property. Its purpose is to divide the RadMenu items equally between the number of columns.
From the attached image I can see that there are 5 items altogether. In order to divide 5 items between 3 columns the items should be ordered as follows: two for the first column, two for the second and 1 for the last one.
In this case having only one item in first and second column and placing the rest of the items in the third column is not supported scenario using the RepeatColumns property.


Regards,
Boyan Dimitrov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Bill
Top achievements
Rank 1
answered on 24 Sep 2014, 12:09 PM
That is extremely disappointing.  I will need to scrap RadMenu and find something else.  Thanks for responding!  Hope to see this managed somehow in a future release.
0
Boyan Dimitrov
Telerik team
answered on 27 Sep 2014, 06:32 PM
Hello,

A kind of workaround for your case would be adding two empty menu items for both first and second column. This way the items will be altogether 9 and will be divided by 3 in each column. Since those 4 items will be invisible they will not affect the RadMenu appearance. 


Regards,
Boyan Dimitrov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Menu
Asked by
Bill
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Bill
Top achievements
Rank 1
Share this question
or