GridView Items stretched vertically (fullscreen)

I have a GridView which is bound to a collection of items. I'd like to style the items so that the fill the screen vertically. However I can't seem to find a way to do this.

Here you find 4 combinations to choose from for 'grouped' and 'non-grouped' items. It is essentially a matter of playing with horizontal and vertical orientation properties.
<Page
x:Class="App6.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:App6"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<GridView Grid.Row="0" Grid.Column="0">
<GridView.ItemTemplate>
<DataTemplate>
<Grid Background="Green">
<TextBlock Text="{Binding}" Width="100"/>
</Grid>
</DataTemplate>
</GridView.ItemTemplate>
<GridView.ItemContainerStyle>
<Style TargetType="GridViewItem">
<Setter Property="VerticalContentAlignment" Value="Stretch"/>
</Style>
</GridView.ItemContainerStyle>
<GridView.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</GridView.ItemsPanel>
<GridView.Items>
<x:String>10]</x:String>
<x:String>210]</x:String>
<x:String>3210]</x:String>
</GridView.Items>
</GridView>
<GridView Grid.Row="0" Grid.Column="1">
<GridView.ItemTemplate>
<DataTemplate>
<Grid Background="Green">
<TextBlock Text="{Binding}" Height="100"/>
</Grid>
</DataTemplate>
</GridView.ItemTemplate>
<GridView.ItemContainerStyle>
<Style TargetType="GridViewItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="HorizontalAlignment" Value="Stretch"/>
</Style>
</GridView.ItemContainerStyle>
<GridView.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel Orientation="Vertical"/>
</ItemsPanelTemplate>
</GridView.ItemsPanel>
<GridView.Items>
<x:String>10]</x:String>
<x:String>210]</x:String>
<x:String>3210]</x:String>
</GridView.Items>
</GridView>
<GridView x:Name="myGridView1" Grid.Row="1" Grid.Column="0">
<GridView.GroupStyle>
<GroupStyle>
<GroupStyle.Panel>
<ItemsPanelTemplate>
<!-- [Default is StackPanel Vertical] -->
<!--<VariableSizedWrapGrid Background="OliveDrab" Margin="2" Orientation="Horizontal" MaximumRowsOrColumns="2" />-->
<StackPanel Background="OliveDrab" Margin="2" Orientation="Horizontal" />
</ItemsPanelTemplate>
</GroupStyle.Panel>
<GroupStyle.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding GroupName}" VerticalAlignment="Center" TextAlignment="Center" Foreground="Black" Style="{StaticResource BasicTextStyle}" HorizontalAlignment="Stretch" Width="100"/>
</DataTemplate>
</GroupStyle.HeaderTemplate>
</GroupStyle>
</GridView.GroupStyle>
<GridView.ItemTemplate>
<DataTemplate>
<Grid Background="Green">
<TextBlock Text="{Binding Path=ItemName}" />
</Grid>
</DataTemplate>
</GridView.ItemTemplate>
<GridView.ItemContainerStyle>
<Style TargetType="GridViewItem">
<Setter Property="Margin" Value="2"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="VerticalContentAlignment" Value="Stretch"/>
</Style>
</GridView.ItemContainerStyle>
<GridView.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel Orientation="Horizontal" Background="Orange" />
</ItemsPanelTemplate>
</GridView.ItemsPanel>
</GridView>
<GridView x:Name="myGridView2" Grid.Row="1" Grid.Column="1">
<GridView.GroupStyle>
<GroupStyle>
<GroupStyle.Panel>
<ItemsPanelTemplate>
<!-- [Default is StackPanel Vertical] -->
<!--<VariableSizedWrapGrid Background="OliveDrab" Margin="2" Orientation="Vertical" MaximumRowsOrColumns="2" />-->
<StackPanel Background="OliveDrab" Margin="2" Orientation="Vertical" />
</ItemsPanelTemplate>
</GroupStyle.Panel>
<GroupStyle.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding GroupName}" VerticalAlignment="Center" TextAlignment="Center" Foreground="Black" Style="{StaticResource BasicTextStyle}" HorizontalAlignment="Stretch" Width="100"/>
</DataTemplate>
</GroupStyle.HeaderTemplate>
</GroupStyle>
</GridView.GroupStyle>
<GridView.ItemTemplate>
<DataTemplate>
<Grid Background="Green">
<TextBlock Text="{Binding Path=ItemName}" />
</Grid>
</DataTemplate>
</GridView.ItemTemplate>
<GridView.ItemContainerStyle>
<Style TargetType="GridViewItem">
<Setter Property="Margin" Value="2"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="VerticalContentAlignment" Value="Stretch"/>
</Style>
</GridView.ItemContainerStyle>
<GridView.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel Orientation="Vertical" Background="Orange" />
</ItemsPanelTemplate>
</GridView.ItemsPanel>
</GridView>
</Grid>
</Page>
using System;
using System.Collections.Generic;
using System.Linq;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Navigation;
namespace App6
public sealed partial class MainPage : Page
public MainPage()
this.InitializeComponent();
protected override void OnNavigatedTo(NavigationEventArgs e)
CollectionViewSource collectionViewSource = new CollectionViewSource();
collectionViewSource.IsSourceGrouped = true;
collectionViewSource.ItemsPath = new PropertyPath("Items");
IList<Group> groupList = new List<Group>() { new Group() { GroupName = "A" }, new Group() { GroupName = "B" } };
groupList[0].Items = new List<Item>() { new Item() { ItemName = "A1", Group = groupList[0] } };
groupList[1].Items = new List<Item>() { new Item() { ItemName = "B1", Group = groupList[1] }, new Item() { ItemName = "B2", Group = groupList[1] } };
collectionViewSource.Source = groupList;
this.myGridView1.ItemsSource = collectionViewSource.View;
this.myGridView2.ItemsSource = collectionViewSource.View;
public class Group
public string GroupName { get; set; }
public List<Item> Items { get; set; }
public class Item
public Group Group { get; set; }
public string ItemName { get; set; }

Similar Messages

  • 16:9 video, but looks stretched  vertically

    I am making a dvd in dvdstudio pro. My movie clips are edited in iMovie (16:9) and my menus are made in Photoshop with a preset (16:9).
    The problem is, when i burn the dvd and put it into my dvd player that is hooked up to my tv, the picture fills up the whole screen and the menus and video looks stretched vertically. It doesn't look like 16:9. And there are no black horizontal "free areas" either as there usually is when it is 16:9. I have chosen my menus and video to be 16:9 in dvd studio pro. When i press simulate though, it first appears in 4:3, and when i change it to 16:9 it looks like it should.
    What am i doing wrong? I want it to look better on my tv!

    I have set all tracks and menus to 16:9 letterbox in the inspector.
    When I play hollywood movies I see letterboxing on both a widescreen tv and a 4:3 tv.
    When I built my DVD to my harddrive and opened it in Apples DVD player, it looks rectangle, but the height of the rectangle seemed to be too high. I have a 22" widescreen tft-monitor and the black horizontal stripes from the letterboxing are only about an inch tall in fullscreen. If i play a hollywood movie, the "black stripes" are much bigger, about twice as big. This is what I want my movie to look like.
    I have checked the dvd-player and TVs settings but there seemed to be nothing wrong. I mean, the hollywood movies look great. Why doesn't mine?
    How do I get my DVD to have these black stripes from the letterboxing effect?
    Heres a picture on my 22" widescreen.
    http://img11.imageshack.us/img11/3345/bild1k.png
    And on my TV.
    http://img410.imageshack.us/img410/540/img3558.jpg
    Sorry for the horrible quality

  • Video from MacBook Air camera looks stretched vertically. How can I change this?

    I just got a MacBook Air and it looks like whenever I use the camera for video chat or webcam, the results are really stretched vertically. This is driving me nuts since I have to be on client video calls and I look really silly.
    How do I fix this??

    The warranty entitles you to complimentary phone support for the first 90 days of ownership. If you bought the product in the U.S. directly from Apple (not from a reseller), you also have 14 days from the date of delivery in which to  exchange or return it for a refund. In other countries, the return policy may be different.

  • Aspect ratio problem (stretched vertically)

    I have a DVD that was apparently converted from 16:9 to 4:3 by stretching vertically. Is there any way I can squeeze it back down to 16:9 and include black strips on top and bottom? As I recall, iMovie offers a choice for the aspect ratio. So I'm hoping this might be a reasonable place to pose the question. What I have in mind is to import the footage from the DVD into iMovie. I'm hoping that I will then be able to squeeze it back down in the vertical direction and restore it back to the proper aspect ratio.

    A 4:3 DVD has the same number of pixels as a 16:9 DVD. There is a flag on the DVD that tells the TV how much to stretch the pixels horizontally. There are never any black bars on the DVD per se.
    Playing a 4:3 DVD on a widescreen (16:9) TV, black bars are placed left and right by the DVD Player.
    Playing a widescreen (16:9) DVD on a 4:3 TV, black bars are placed top and bottom by the DVD Player.
    It seems as someone rendered your DVD with the black bars imposed on the image on the DVD, which is not the proper way. There isn't anything you can do about that: You can't get back the pixels lost in the process.

  • How to move or swap two GridView items?

    Hi, 
    am developing a windows store 8.1 app.
    I have four GridView items in the GridView like the above figure.
    Now i want to swap the GridView Items.
    Now i click on 1(GridView Item) and then later i click on 4(Grid View Item)
    Then both items has to be swap(4 should be replaced by 1 and 1 should be replaced by 4).
    How can i achieve this?
    I don't wanna use  CanReorderItems="True" AllowDrop="True" CanDragItems="True" these properties to swap.
    Any help please?

    <Page
    x:Class="GridViewItemSwap.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:GridViewItemSwap"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">
    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
    <GridView x:Name="gridview" IsItemClickEnabled="True" ItemClick="gridview_ItemClick" >
    <GridView.ItemTemplate >
    <DataTemplate >
    <Border Margin="12" Width="100" Height="100" Background="Blue" >
    <TextBlock Text="{Binding}"/>
    </Border>
    </DataTemplate>
    </GridView.ItemTemplate>
    </GridView>
    </Grid>
    </Page>
    namespace GridViewItemSwap
    /// <summary>
    /// An empty page that can be used on its own or navigated to within a Frame.
    /// </summary>
    public sealed partial class MainPage : Page
    private int? firstvalue;
    private ObservableCollection<Int32> data = new ObservableCollection<int>();
    public MainPage()
    this.InitializeComponent();
    for(int i =0 ; i <4; i++)
    data.Add(i);
    gridview.ItemsSource = data;
    private void gridview_ItemClick(object sender, ItemClickEventArgs e)
    if (firstvalue.HasValue )
    Int32 secondvalue = (Int32)e.ClickedItem;
    var firstindex= data.IndexOf(firstvalue.Value);
    var secondindex = data.IndexOf(secondvalue);
    data[firstindex] = secondvalue;
    data[secondindex] = firstvalue.Value ;
    firstvalue = null;
    else
    firstvalue = (Int32)e.ClickedItem;
    在現實生活中,你和誰在一起的確很重要,甚至能改變你的成長軌跡,決定你的人生成敗。 和什麼樣的人在一起,就會有什麼樣的人生。 和勤奮的人在一起,你不會懶惰; 和積極的人在一起,你不會消沈; 與智者同行,你會不同凡響; 與高人為伍,你能登上巔峰。

  • Aurora 30.0a2 toolbar and icons are stretched vertically and out-of-proportion, how to fix this?

    In the latest update changes Aurora 30.0a2, the UI shows the toolbar as stretched vertically. all the icons appear to be about (+/-) 1 to 1.5. This is no major issue and really just a minor visual nuisance but is a bug nonetheless.
    image: http://tinyurl.com/qzx8y6y
    Only the toolbar is affected, all other areas retain their 1 to 1 ratios.

    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Compressed Web movie looks stretched vertically instead of 16:9, HELP!

    Hi guys, I shot some footage with Canon XL2, 16:9, 24pa.
    After editing I put it in compressor 3 to make a quicktime 7 H.264 web streaming movie,
    with frame size 720x480,
    but the movie is stretched vertically.
    Can anyone help me with the settings to keep it 16:9.
    Thanks
    Zia

    Just set the frame size to a Custom (16:9) aspect ratio in Compressor, and the pixel aspect ratio to Square. You find those settings in the Inspector window, under the Geometry tab.
    Calculating the aspect ratio manually is pretty easy too, but when using Compressor, you can just let Compressor do the job.
    Width / 16 * 9 = Height
    I would recommend implementing frame controls in your workflow too. Have a look at this post: http://discussions.apple.com/message.jspa?messageID=7309534#7309534

  • Iphoto slideshow stretching vertical photos

    ARGH! I hope someone can help me. I'm creating a slideshow for my daughter's bday and it has about 285 photos in it currently, a good mix of horizontal and vertical. There are about 20 vertical photos that are appearing stretched horizontally when viewed in slideshow mode. There are many more verticals that this is not happening to.
    I edited (rotated) them in Photoshop and saved them, as I did for every vertical photo in the album. They are not rotated in iphoto. When I do rotate them in iphoto (just for troubleshooting), they are still stretched, just now rotated incorrectly.
    Can anyone tell me why this is happening, especially to SOME and not ALL?
    Thanks in advance!

    Which version of iPhoto?
    I've run into unexpected things when editing iPhotos w something external to iPhoto. I think the problem has to do with the way iPhoto stores photos - basically an original and then one with any changes made to it.
    Try this: Put a copy of all of your Photoshop-edited photos in a folder on your hard drive outside of iPhoto. Then delete the problemmatic vertical photos from your iPhoto Library.
    Then import your Photoshop edited vertical photos as if they wer enew photos.

  • The tabs and icons for org. tabs is stretched vertically, the icons are triple row! Also no x in the right top corner.

    When looking at the screen, the tabs are 3 times higher than any of the other browser areas (address bar), favorite locations etc. The icons to the right for organizing tabs are repeated vertically 3 times! Additionally menu issues. I have no menu, but just a tab marked "Firefox" in the upper left. If I take the menu off, I lose my bookmarks as well! I tried to restart in safe mode using:
    firefox -safe-mode
    But that did not work. Also using the "Alt" key did NOT show my menu even for a second.

    I'm not sure what you mean by "connection scale". If you are referring to the padlock, this has been replaced by the site identity button, for details on using it see https://support.mozilla.com/kb/Site+Identity+Button
    The Home button by default has been moved to the right hand side of the navigation toolbar, you can move it back. For details of how to do that see https://support.mozilla.com/kb/how-do-i-customize-toolbars
    If any buttons are missing, you can restore them as shown here - https://support.mozilla.com/kb/Back+and+forward+or+other+toolbar+items+are+missing

  • LR3 Stretches Vertical photos to be Horizontal, help!

    I have been using LR3 since the first beta and never had this problem until yesterday. I imported my RAW files into LR and any that I shot that are vertical will rotate horizantal but keep the image as a vertical and stretch it out to make it fit in the box and distort the photo making it incredibly difficult to work with.
    What's going on? Is this a bug or did I do something wrong?

    The one image I can see this (but only for a subsecond) is a DNG from a Nikon D3, which is not one of my cameras.
    I think slowness of LR can not be the reason, unless you're importing 10'000s of photos in one go. As I said, if I import this one photo, I can only see the effect for less than a second (and I have a slow machine).
    I this effect reproducible if you import some of these photos, for example into a new, fresh catalog? If not, try deleting/renaming your Previews folder and let LR build the previews again.
    Beat Gossweiler
    Switzerland

  • 720p Motion project stretched vertically on Quicktime export...why????

    Everything is fine in my HD 720p24 Motion project. But when it comes to exporting it as a Quicktime movie, the project gets vertically squeezed...as though Motion were squeezing 16x9 into 4x3.
    Does anyone know the solution to this problem??? Isn't there a letterbox option in Export settings so that the exported movie remains 16x9???
    - Nicholas

    Or keep it as 960x720 if you want to continue using it in FCP...
    Patrick

  • Panel tab component not stretching vertically

    I have a jsff page.
    I have two sections in the page .
    1. top is a panel header and
    2. below it is a panel tab component.(ADFStretchwidth is already set .)
    When i ran the page the the page is renderring, but below the tab panel Still there are some space left .
    I want to render the tab to occupy the whole space .
    I have already tried using a panel stretch layout but it didnot work.
    Any pointers ??
    Thanks
    Sumit Yadav

    Hi Sumit,
    Try as mentioned below:
    <af:panelTabbed id="pt2" dimensionsFrom="disclosedChild">
    <af:showDetailItem text="#{'Tab1'}" id="sdi1"
    styleClass="AFStretchWidth" stretchChildren="first" >
    </af:showDetailItem>
    <af:showDetailItem text="#{'Tab2'}" id="sdi2"
    styleClass="AFStretchWidth" stretchChildren="first" >
    </af:showDetailItem>
    </<af:panelTabbed>
    Thanks,
    Navaneeth

  • 16:9 stretched vertically on a 14" portable TV!

    Ive created a film in Final cut pro at 16"9 ratio PAL, when I take it into DVDSpro 4.2 and burn it on a wide screen tv it look fine except the main memu which is the wedding ring one it wont go to 16:9 ratio?
    When the film plays on my wide screen Sony 36" TV it fills the screen fine but on a combo 14" portable it is stretched verically - how do I compinsate for this in DVDSpro?

    When the film plays on my wide screen Sony 36" TV it fills the screen fine but on a combo 14" portable it is stretched verically
    Two possibilities: (1) when you created the track did you set it to 16:9 letterbox? If not the track won't get letterboxed properly on a 4:3 TV. (2) are you sure the DVD player in the 14" portable is set to 4:3 instead of 16:9?

  • MPEG-4 in widescreen stretches to fullscreen in iDVD

    I import an mpeg-4 file into iDVD and i burn the project. The mpeg-4 is a widescreen format but it is stretched when I play the dvd in any dvd players other than my G5. Is there anything to do that will keep it widescreen in other dvd players? any workaround or anything? HELP!!

    Welcome to Apple Discussions!
    What happens when you try to play the videos on your
    iPod? Are they not there?
    Also...
    iPod Plays Video But Not Audio - Muxed
    Files
    btabz
    Yes, my videos are not there at all on the i-Pod, but the videos I bought from i-Tunes all show up and play. And I have constantly updated i-Pod and i-Tunes.
    Strange thing is, ALL the videos (mine and purchased i-Tunes) show up in i-Tunes and can play in i-Tunes.

  • When switching to 16:9, Keynote stretches all fullscreen images

    My presentations are hundreds of slides, no text, 1024 x 768.
    Occasionally, a client wants me to present on a 16:9 screen. I go to the document pane and change it to 1920 x 1080 and voila... EXCEPT
    Except that any image that was full size (covering the whole screen) is stretched. Not only that, but the metrics pane is set for constrain proportions. So now for each and every slide, I have to go in, uncheck constrain, move the picture so I can see the handles, use my eye to judge what it ought to be, unstretch it, and move it back where it belongs.
    How do I instruct Keynote to leave these pictures alone, the same way it leaves any picture that isn't all the way to the edges alone?
    Failing that, how can I change the images in bulk?
    Thanks!

    I appreciate your patience.
    Imagine a photo that shows 10 people side by side (Albert Einstein is in the middle). In the original presentation, I placed the photo to fill the squarer aspect ratio, and thus only 7 people are shown, 2 cropped out to the left and one to the right. But Einstein is still there, so it's a great shot.
    Now, I get the chance to use the wider aspect ratio, because the presentation will be done for 1000 people on a really expensive 16:9 hd projector. Great.
    I change the aspect ratio of the presentation and Keynote does exactly the wrong thing. It stretches the photo, making it wider but not taller, so that einstein and the other brilliant scientists are stretched wide, making them weird.
    So I have to go that slide, click on it, go to the inspector, unlock the aspect ratio (which Keynote ignored), slide it a little so I can see the handles, grab the side handle and make it narrower to get the faces back to thin again (by eye) and then slide it back so all 10 guys are showing.
    There are no circumstances under which the user would EVER want Keynote to take a picture and make it wider and not taller. And yet it does.
    The fascinating thing for me is that if I start with the picture inset just a little from the edges of slide, Keynote leaves it alone.
    So, unless you can help me, I have to take my original, make every picture a little smaller, then change the aspect ratio and then go back and make every picture fill the screen.
    Hope that was clear. I thank you and Albert thanks you.

Maybe you are looking for

  • How do I find music I want by sample?

    There is a sample of music in YouTube. I want to find more of the same by that sample. So how do I find more? The sample is of laser harp play, but I am interested in the sound of it. The sound is deep and metallic, vibrating, almost menacing, myster

  • Question about choosing an external dvd/cd burner

    The burning speed listed in my iTunes preferences goes up to 24x, then "Maximum Pssible". I am thinking of purchasing a LaCie DVD/CD burner that has write(48x)/rewrite(32x)/read(40x). When using with my iMac does this mean that I can burn at 48x with

  • Cairngorm 3 maveninze

    Hi , Has anybody mavenized a project containing cairngorm 3 libraries. We use Navigation library of cairngorm 3  :    <dependency>             <groupId>com.adobe.cairngorm</groupId>             <artifactId>navigationParsley-flex3</artifactId>        

  • Final Cut crashing on startup - Please Help

    I've never had an issue with my Final Cut before until today and have to urgently create a dvd in DVD Studio Pro but it keeps on crashing on startup. It does the identical crash to Final Cut as well. *The report shows this...* +Process: Final Cut Pro

  • How to hide and resume a native activity in flex app

    what i want to do is like this: (1)start an activity by the native extension when lauching the application and then display a list for users to choose (2)make a choice and send it back to the flex (3)flex does something and then jump to the native li