Last post Apr 09, 2009 05:39 PM by PeterBrunone
Apr 07, 2009 05:15 PM|Sachyn Ghodke|LINK
Here is what I want to do:
To display a drop down menu with multiple column listing which can be added, edited or deleted from a module that can be linked through the backend for a CMS website.
Here is my problem:
At my office a certain section of developers are saying that this is not possible in .net but some enthusiastic ones beg to differ and fight back saying that this is possible.
What i want really is to be able to add, edit or delete links in this drop down menu which has multiple columns.
What needs to be kept in mind is this:
(1) First column is always long if there are odd number of links to be set in the menu. For example: if there are 11 links to be displayed in 2-column format then the first column will have 6 links and the second column will have 5.
(2) If there are even links then both columns will have equal number of links.
(3) If one link is added anywhere in the first column of the even-column menu then the last link in first column will move to the top of second column and the first column will have links more than the second column.
(4) If two links are added anywhere in the multiple column menu then both the columns should show equal links and balanced two columns.
This same rules apply to the menu which is more than 2-columns. However, one thing needs to be kept in mind is that this is a DHMTL menu.
What I want from my peers and experts:
Logic or solution how this can be done.
Please roll over on the "Artists" link next to the "Home" link.
Hope you guys can help me.
Thank you all in advance.
Apr 08, 2009 02:21 AM|Westnyorai|LINK
You should be able to just use a literal control in the code behind, or a placeholder in insert the html controls directly.
I think the question needs to be, if you have a set number of columns, if so all you have to do is divide the total number of links by the number of columns and figure out the remaining links and distribute them evenly starting from left to right.
store the links, but I don't think it would be that difficult in XML.
Without writing any real code the logic would be something like...
Create an array for X columns.
Determine how many rows for each item in array.
User serverside code to retrieve links and arrangement starting with column x to y.
For adding and deleting you can either use a back office type system or...
If you want to add the ability to set the location of each link, you'd have to include some sort of position identifier.
Hopefully that gives you some clue to get you started.
Apr 09, 2009 05:39 PM|PeterBrunone|LINK
Why not use a DataList control? You have control over the orientation, repeat direction, number of columns, etc.