I have a page using a Treeview server control like so:
<asp:TreeView ID="uxTreeView" ShowExpandCollapse="True" ShowCheckBoxes="All" runat="server"></asp:TreeView>
What I expect to have happen is my treeview should render a series of checkboxes, with the first level having a plus sign (+) to expand it, and then a minus sign (-) when it's expanded to collapse it.
For some reason, I'm not seeing the expand/collapse links. I can see there's a parent and a child node, and they're properly nested, but the expand/collapse links aren't showing.
Has anyone seen this before? In the past this hasn't been an issue - dragging and dropping the control onto a page has worked fine. I've inspected the elements with Firebug, and I didn't see any CSS that would hide the expand/collapse links.
UPDATE
I've found there's an ImageSet property on the treeview - now my treeview is actually adding the arrows for the various nodes indicating whether they're expanded or collapsed. Is it possible to style the individual cells in the outputted table? (It looks like this would be a lot of work)
Did you by chance specify custom images, perhaps incorrectly, for the expand and collapse elements?
Related
In Visual Studio 2010 if I click on any <div> or <span> anywhere in the design view it selects this one grid always. Has anyone ever seen this? Are there any ways to fix this?
The only controls in design view that I can click on are textboxes / dropdowns / buttons / linkbuttons etc. So when I want to quickly jump to a span to edit its contents I have to click on the nearest one of those controls then make my way over to the <span>. Cause if I click on the <span>, BOOM highlight the gridview. It is driving me insane!
UPDATE
when i exceed 17 columns in the gridview this is happening. anything less than 17 does not cause this issue. i'd say this is a bug, and after a certain amount of columns the gridview does not function properly in design view and throws off other elements in the page.
This is what I have done do "work around" this problem.
It is a design view problem, not code.
Any time you have a grid view that has enough fields to push if off to the right of the visible editing area in design view, this bug will occur. Clicking spans and divs will always highlight that grid, it is so annoying.
You can expand your design view window wide enough to see the entire grid and this problem goes away for the time being. it is extremely annoying but works.
i am sure there are other work arounds but i have not seen anyone else have this problem (most people dont use the design view).
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.
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();
I'm using vb.net. Basically, I have a drop down list, text box and a submit button. You choose a movie director from a drop down list, then type in a movie, click button and it adds the data to my database.
There's another button which hides/shows drop down list, text box and submit button using Visible = True and Visible = False, but what I don't like about it is when it hides the things I said before, it leaves some white/empty space like if they are still there, but not visible.
Is there anyway to put some kind of holder/container and place a button which when clicked could add my drop down list, text box and submit buttons to that place?
Cheers,
E.N.
I assume that you are working with WinForms in Visual Studio. In the Toolbox the controls which could help you out of this situation are in the "Containers" section. Among others, there is a Panel, a FlowLayoutPanel and a TableLayoutPanel (see this video on msdn for a TableLayoutPanel Demo). They can help you to organize controls. Especially the FlowLayoutPanel places the controls automatically. But you can always change the Top and the Left properties of any control, to move them around to the desired place or group some of them on a Panel and change the Location of this one one.
You can add a control to a container by using the Add method of its Controls property. However, if the control is already on the form (since you are asking how to add an existing control) you must remove it from the form before.
Me.Controls.Remove(myButton)
panel1.Controls.Add(myButton)
I have a display problem when I try to use a ajax combobox inside a tab control:
when my tab control loads on the page where the combobox is, everything works fine; however, if it loads on a another page, the you change to the page which contains the combobox, the right button (which opens the list of the combobox) isn't displayed at all.
Has someone been through this behavior? And maybe found a solution ?
Thanks in advance !
Use Firebug in FireFox (this tool is very good if you dont use it) and right-click the area where your drop arrow should be, then select "Inspect Element". At the bottom of your browser screen, you will see a couple windows. One window will detail teh styles being applied to the arrow area.
Look for a style that is making visibility of either a <td> or <img> to be hidden. The Ajax ComboBox control, sadly, is laid out in a table.