Extend Silverlight Combobox's dropdown over aspx content - silverlight

I have an aspx page, with a div that I want to replace with a Silverlight application. The content inside this div is responsible for filtering some data, and is quite small (200 pixels x 200 pixels about).
One of the comboboxes in the Silverlight app that I made to replace that content, contains a long list of items.
If I expand that combobox, it only fills the space available to the Silverlight control, i.e. 200x200 pixels. Is it possible to have the combobox dropdown extend to outside the Silverlight control's confines?

You can use Silverlight in windowless mode (in this mode you can put html over silverlight) and use list from HTML which will be over Silverlight.
Silverlight combobox can't extend beyond the Silverlight area.
If the list of items so long, you can simply use scrolling in the combobox.

Related

WPF ItemsControl - How to detect when an item is not visible

I'm building a WPF application to visualize a load of items (a few thousand). For this i'm using an ItemsControl of which the ItemsSource is set to a BindingList.
I've noticed that it takes some time to initialize the screen... The main bottleneck is the creation of TextBlock elements (the data template of the items contains 4 TextBlock elements). Once the screen is initialized (when all WPF elements are created), rendering is quite OK.
I've implemented zooming and panning, so i was thinking about making the appearance of the items dependent on the zoom level and the center point (a bit like Google Maps: data is only visualized for regions that are into the view).
How can this be done? Is there any way in WPF to ask the item or item container if it is currently clipped?
You can make your list virtualized. This way only the items that are visible will have UI controls created for them.
Check the ListView documentation, or this link may help:
http://www.codeproject.com/KB/WPF/WpfDataVirtualization.aspx
Jogy

How I can Save layout in Silverlight

I am working on silverlight application and I want save layout as a sheet.
The flow is here.
I Have StackPanel and children of StackPanel is WrapPanel and inside the WrapPanel I am adding multiple Images.
The Size of the StackPanel is according to user define height and width.
so how I can save this sheet.
Thanks..!!!!
In WPF there exists a XamlWriter which can write your Visual Tree to a XAML string. However, this is not available in the Silverlight APIs. Fortunately someone has written a XamlWriter for Silverlight and it is available here:
http://www.davidpoll.com/2010/07/25/to-xaml-with-love-an-experiment-with-xaml-serialization-in-silverlight/
With this you can save your 'sheet' to a XAML string, the use XamlReader.Load to reconstruct it:
http://msdn.microsoft.com/en-us/library/cc189076%28VS.95%29.aspx

Silverlight: How to display items in a grid?

I'm using Silverlight 4. I know how to display items in a vertical or horizontal list using a ListControl or ItemsControl. However, I want to display items in a grid, like you'd see Windows Explorer viewing in grid of icons. How can I do this? Is there a control, or must I use a hack like ItemControls of ItemControls?
you probably want the wrappanel in the silverlight toolkit. here's an old example but you get the idea: http://blogs.silverlight.net/blogs/justinangel/archive/2008/11/05/silverlight-toolkit-wrappanel.aspx

Is it possible for WinForm controls (Panel,etc.) to grow like a webform control?

I'm converting an app from ASP.NET WebForms to WinForms. There is one asp.net page which contains a ListView/Repeater that contains several custom controls, which in turn contain a ListView with other custom controls. Basically the layout looks like a TreeView, but on each node/leaf there are few controls like comboboxes, etc.
When this is in ASP.NET, the page automatically lays itself out, so it is several screens tall - if I add 20 buttons into a Panel, it will grow and the browser will get scrollbars.
I'd like to do the same thing in a WinForms application - so I'll have a user control that will contain a lot of controls in a some variation of Panel (Flow, Table layout), and the controls might have another controls inside them, etc.
The problem is, that when I make winforms app, each control has specific height in the design time. I'd like some user controls to be able to grow with their contents - so they'll add up. In the main Form, there should be a vertical scrollbar, just like in the web browser when the generated page is taller than the screen.
I'd just like to get some general pointers in the right direction. Thanks.
Use Anchor and Dock container properties.
Yes, to expound on Anchor and Dock...try this
-Place a Panel on an empty form, and set its dock property to Top
-place a textbox in the panel, and Dock it to Full...it should fill the whole top panel
-Place a splitter on the form, and if not already docked correctly, set its dock to top
-place another panel below the splitter, and set its Dock to Fill
-place another textbox inside the lower panel and fill it as as well
Now you have a form with two resiable textboxes and will resize when the form does.
*you may have to set the textbox MultiLine property to true but not sure.
Hope this helps.
Anchor the controls to the parent. Anchoring all four sides will cause it to stretch.
If the Anchoring and Docking answers don't work for you, there is another option. It's not pretty, but you can access a control's properties and change them dynamically during runtime. You'd do something like: if(listBox.Items.Count > [yourVal]) listBox.height = [yourFormula] or something.
It's been a while since I've done a Win Form (and I don't have my IDE fired up at the moment) but I'm pretty sure there's even a ScrollPanel or other scrolling control that you can set on your form.
That said, when you're working with WinForms, the less scrolling you can make your users do, the better.

Silverlight light dropdown

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.

Resources