Use Site Map for Two Levels of Horizontal Navigation - asp.net

How do I use the ASP.NET sitemap control to render stacked horizontal css menus with styled UL/LIs? It seems to only want to do trees or flyouts.

Set up a SiteMapDataSource and point it at your configured SiteMap Provider. Then bind a repeater (or whatever) to the data source. Use the repeater to emit your UL/LI sturcture.
If you need 2 levels (like nested tabs, where the second level tabs are children of the selected tab at the top) then you will need 2 SiteMapDataSources and set the starting node of the second to the selected node of the first.
This is all from memory of when I did this a couple years ago - so it may not be 100% exact.
If you have specific problems after trying it out, post and I will work out more details if needed.

I googled and found this thread:
http://blogs.sqlxml.org/bryantlikes/archive/2006/02/17/4839.aspx
It seems you have to build your own control. I hope it will move you in the right direction.

Related

Designing Custom Drop Down with mulitple rows and columns

I have a requirement like for the drop down as shown. Could any one help me in achieving this.
Briefing:
On click of the button a pane should be opened which contains rows and columns containing text, on click of it appropriate action need to take place. The source can be dynamic too....
There are many techniques for acheiving this design. You could do it purely with html and css by having an image that looks like a dropdown popup an absolutely positioned div underneath. Or you could use the asp.net ajax control toolkit control called "PopupControl" that essentially abstracts all the html/css away allowing you to just specify a target panel. There are also various jquery plugins, here is one from abeatifulsite.

Keeping ASP.Net TreeView nodes collapsed when navigating web site

I noticed that when navigating an ASP.Net web site the nodes in the TreeView always expand.
Is there a setting or attribute we can include in the markup that will keep the TreeView nodes collapsed until the user expands them?
Maybe something is needed to be added to the code-behind file?
Yes there is, it's called ExpandDepth
ExpandDepth - Gets or sets the number of levels that are expanded when a TreeView control is displayed for the first time.
If you want all the nodes, including the root, to be collapsed just set it to 0
<asp:TreeView ExpandDepth="0" ...
I don't think you can do this in the markup. But it is possible in code - behind. Check out this link for some sample code: Collapse all open nodes.
I'm pretty sure that an app I wrote a few years collapses the entire tree with one line of code (like you we found that it kept opening up every post back). If this link doesn't work I will post the code I used tomorrow.
The one line of code I was looking for is
tv.CollapseAll();

Dropdownlist - number of display element

I have dropdownlist on my webpage.
When I click it the list with all items is expanded. But this list is very long.
How can I change it to achievie a list with (e.g.) 5 displayed items and with a scrollbar next to them.
If it is not possible, how can I do it with ListBox? I know it is Rows property there but can I declare how many rows is display all the time not after expanding the list.
This control, will, of course be rendered on the page as a standard <select> control.
With these, the height of the list once its dropped down is determined by the browser, and you have no control over this. You'll notice when the list approaches the foot of the page, the browser will implement the scrollbar as you suggested, but not with the number of items you maybe want.
My only suggestion would be to investigate the options offered by some client-side drop down add-ins. You may be able to find some jQuery ones that will help.
A simple google search for "jquery dropdowns" yielded this article as the top result: 38 jQuery And CSS Drop Down Multi Level Menu Solutions. If you can't find something here then there are also plenty similar sites in the search results.
I think this post provides you with a couple of different solutions to your problem.
http://blogs.msdn.com/b/rakkimk/archive/2011/05/02/dropdownlist-html-select-vertical-scrollbar-number-of-items.aspx

Navigation issue in Flex - ViewStack, states or something else?

I have a bit of doubt regarding my application which is being created using Mate framework. The first thing user has to do is to log in, so I created Login.mxml view. After a successful login I need to display the main view with applicationControlBar at the top and a workspace below. At the moment I have two separate views, so if I understand correctly it makes sense using ViewStack.
Thing is, I'd like also to display some kind of panel with buttons on top of the workspace after login - here is screenshot. After clicking on a button the panel should dissapear. To complicate things a little bit more, there is a possibility for this panel to change state. Clicking on a specific button may result in showing progress bar at the bottom of panel.
I feel I should create separate view, MenuDialog.mxml and put there buttons, progress bar and states, but how to display it on the top of the workspace? I hope my problem is clear enough :)
I would make the panel a popUp, with the main application (or the ViewStack's parent container) as the parent of the popUp. You can use the PopUpManager Class to close it based on user actions within the Panel.
Assuming that perhaps you do not want a modal login style panel (which many apps these days eschew) then you should absolutely use states rather than ViewStacks.
States are a much cleaner way to distinguish the various, uh, states that your UI can be in -LOGGED_IN, LOGGED_OUT, etc.
It may take a little to get used to working with states, but once you do, you'll never go back. :-)

Flex collapsible field group control

I am trying to make a side panel in a Flex application that would hold a bunch of properties of a selected object. The number of properties may become huge, but they all fall into some certain categories.
For that, I am looking for a flex control that would be like a collapsible field group. Or like an accordion that can have multiple open panels at a time. Do you know, where can I get one?
UPDATE: I want something like the second example on the following page: http://extjs.com/deploy/dev/examples/form/dynamic.html
Thanks,
Artem.
http://www.flexdownloads.com/#view=detail;vstr1=19
is what you are looking for.
It sounds to me like you are looking for some sort of tree component. Flex actually has one of those and you should probably take a look at it.
This is a good link to see what controls are included in flex http://examples.adobe.com/flex3/componentexplorer/explorer.html

Resources