I have a Silverlight form that contains a Stack Panel (orientation = vertical) with 10 rows. Each row contains a TextBlock and Textbox control except the last row has a TextBlock and Drowdown.. At the bottom of the control are two buttons. Previous & Continue.
There are 10 items in the Dropdown. When I select a value from the Dropdown, only two of the ten items are showing up. I believe that the remaining items aren't displying because there's some sort of clipping effect going on. Fair enough.
Does Silverlight allow the dropdown control to display upwards (instead of the default down direction)? Will I have to override some rendering capabiliities before the dropdown is rendered to the control or is there a property that allows me to accomplish this functionality?
The Silverlight ComboBox auto aligns the dropdown popup to always be visible whenever possible.
all Popup based controls (ComboBox, AutoCompleteBox, DatePicker and TimePicker) all have this feature enabled.
So if there's not enough screen real-estate below the ComboBox to show the dropdown popup, it'll show up above the control.
The combobox nesting in the visual tree should not affect the dropdown popup auto alignment. The internal Popup control (inside the ComboBox) ignores the Visual Tree and is nested "above" the visual tree.
If you have specific issues, please share minimal and relevant XAML. Since Keith is on this thread, I think it's safe to say he'll log a bug if needed.
Related
So I have a form with a tabcontrol that takes up the entire view. I have 3 buttons that I have managed to get to be on top of this tabcontrol at all times. I have a 4th button that is always underneath the tab control. How do I get always on top like the others?
The order that controls, in the same container, appear (both visually and interactively) is determined by their "z-order". The term z-order is referring to the 3rd dimension, depth which is often referred to as the z axis.
In WinForms, the z-order is determined by the order in which controls are added to a ControlsCollection (i.e. Control.Controls).
You can see the z-order of controls (as well as container grouping) by opening up the "Document Outline view" when viewing you Form's designer view. This lists every control and every container. They are indented by their container and the z-order is the order they appear in. You can use the up and down buttons to move the selected item up or down in z-order.
Try right mouse clicking the TabControl (not the TabPage) and from the menu, select Send to Back
I want to add the menubar to TextBox control in Silverlight 4. (I will create a new reusable control.) The menubar will consists of a few image buttons. The idea is that it will normally stay hidden and will show up only when the user puts his/her mouse cursor to the TextBox area. If used in a multiline textbox, whole menubar can fit inside it, this should be easy. (I hope. :-))
But how to solve situation when TextBox is in single line mode? I'd like to put the menubar above the TextBox. But I don't have a clue how to do it. Can somebody help? I need to let all other controls in a form to stay in their positions, and only add my menubar above my textbox. (So the menubar will NOT hide the textbox. Instead, it will hide other controls residing right above the textbox.) It should work in all arrangements of form, like Grid, StackPanel, Canvas etc. In the fact it would be similar to a classic right-click context menu, but not modal. (Right-click context menu is modal, i.e. while it is shown you cannot use other controls, and it automatically hides when you click anywhere else. I want my menubar to stay visible as long as user heeps mouse cursor over the textbox or the menubar.)
Example: Coordinates of textbox are top=100,left=20,bottom=115,right=120. So my menubar's coordinates should be bottom=100,left=20, right & top are based on size of menubar.
If many textboxes will be used on a single page, each single one should have its own menubar. (Of course.)
You can create your own control (custom control or UserControl, whichever you like should work) which has the TextBox, and the visual for the menu bar.
If the TextBox is single-line, you could display the menu bar in a Popup which you position just above the TextBox whenever the mouse is over it.
If the TextBox is multi-line, you'd simply use a StackPanel or Grid or whatever to do layout like normal, if I am understanding what you want.
No coding required if you use this menu:
http://sl4popupmenu.codeplex.com
To achieve this behavior you will need to set its IsPinned property to true.
I'm using the DevExpress WPF grid control. When you hover the mouse over a grid cell, and that grid cell is too small to display the entire value, a tooltip is automatically generated containing the full value, like this: (sorry, print-screen doesn't capture the mouse pointer)
Is there any way to suppress this? Ideally, i'd like to suppress it for only certain grid columns if possible.
The MSDN documentation for the event FrameworkElement.ToolTipOpening (exposed by the grid column) says:
To prevent a tooltip from appearing in the UI, your handler for ToolTipOpening can mark the ToolTipEventArgs event data handled.
However, I've tried that, and it doesn't work in this case. Other posts on the web refer to using a TooltipController, but since I'm using the WPF grid, there's no such class (that I can see).
You can forbid toltip by setting the column's Settings.ShowTooltipForTrimmedText to false.
My requirement is rather a tricky one (it seems to me).
I will explain the scenario.
I have a DataGrid. In the DataGrid, I have two columns in which I have a grid in every cell of these two columns, inside of which, there are two comboboxes - the purpose being to switch the visibility based on some conditions.
When we select a value in the combobox, the combobox itself, plus some other controls in some other columns will get disabled (requirement of the pjt). Now there is also, another requirement like, Tab should not be allowed in the cell which has disabled controls - say disabled combobox.
We are setting the controls as Enabled or Disabled based on a selected value from the combobox. So, since we are applying the disabling property on the control level, and the IsTabStop property is on the cell level, I am not able to restrict Tabbing in the cells having disabled control.
Any thoughts?
Don't use a DataGrid.
DataGrid's are awesome for read-only stuff, but they seem to suck for doing any kind of interesting editing. After well over a week of fighting with it, I've given up on it.
Right now I'm looking for a replacement, which may end up just being a scrollable stack panel with manually added controls.
WPF: Is there a "ListBox" without the ability to select items?
I've written an 'auto-suggest' textbox user control in WPF. It behaves a little bit like the 'To' list in Hotmail, allowing the user to enter a list of items, offering suggestions when it is able.
The main controls are a a text box, a wrap panel and a list box. The text box captures user input. The wrap panel contains the text box and shows previous entries. The list box is used to show suggestions. Most of the time, the list box is hidden.
I'm using multiple instances of my control in a stack panel.
My problem is that when the list box is shown, it is included in the measurement of the height of the control. This forces the following controls in the stack panel to be shifted down, as these pictures demonstrate:
alt text http://img13.imageshack.us/img13/8366/example1a.png
alt text http://img208.imageshack.us/img208/7664/example2a.png
I've tried overriding the measurement of my control so not to include the list box, but this just results in the list box not being visible.
What I want to do is make the list box overlay any subsequent controls in the stack panel, like a combo box's drop down would do. However, I really don't know how to do this. Any ideas?
Thanks
Sandy
You might want to have a look at the Popup control. That is what the ComboBox uses to display its options. Good luck!
Try this instead of your text box / list box combination: A Reusable WPF Autocomplete TextBox