locked
How to position Gridview header on the left and use variablewrapgrid for all items to fill up the item space ?

    Question

  • how can i achieve this by by showing my gridheader on the left ?

    19karabo91

    Friday, August 15, 2014 9:48 AM

Answers

  • Ok, I understand, you are working for GridView group header but not GridView header.

    See a similar question: http://stackoverflow.com/questions/12111619/change-gridview-header-placement

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by 19karabo91 Monday, August 18, 2014 10:25 AM
    Monday, August 18, 2014 10:13 AM
    Moderator

All replies

  • Hi 19karabo91,

    The GridView header already position on the left by default as you can see:

    to customize the header template is necessary:

            <DataTemplate x:Key="DataTemplate1">
                <Grid>
                    <Button>header</Button>
                </Grid>
            </DataTemplate>
    
    
    
    <GridView HeaderTemplate="{StaticResource DataTemplate1}">

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    Monday, August 18, 2014 9:40 AM
    Moderator
  • Not really because after i add a gridview and the header it appears on top of the Gridview items

    19karabo91

    Monday, August 18, 2014 9:53 AM
  • What is your GridView code?

    I shared my code here:

        <Page.Resources>
            <DataTemplate x:Key="DataTemplate1">
                <StackPanel>
                    <Button>header</Button>
                    <Button>header</Button>
                    <Button>header</Button>
                </StackPanel>
            </DataTemplate>
        </Page.Resources>
    
        <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
            <GridView HorizontalAlignment="Left" Height="282" Margin="403,179,0,0" VerticalAlignment="Top" Width="622" HeaderTemplate="{StaticResource DataTemplate1}" >
                <x:String>asdsada</x:String>
                <x:String>asdsada</x:String>
                <x:String>asdsada</x:String>
                <x:String>asdsada</x:String>
                <x:String>asdsada</x:String>
                <x:String>asdsada</x:String>
                <x:String>asdsada</x:String>
                <x:String>asdsada</x:String>
                <x:String>asdsada</x:String>
            </GridView>
    
        </Grid>

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, August 18, 2014 9:57 AM
    Moderator
  •   <GridView.GroupStyle>
                            <GroupStyle>
                                <GroupStyle.HeaderTemplate>
                                    <DataTemplate>
                                        <Grid Margin="0,6,0,6" Height="140">
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="20"/>
                                                <ColumnDefinition Width="*"/>
                                                <ColumnDefinition Width="20"/>
                                            </Grid.ColumnDefinitions>
                                            <Border Grid.Column="1" BorderBrush="{Binding CompanyColor ,Mode=OneWay,Converter={StaticResource HexToColor}}" BorderThickness="0.9" CornerRadius="6">
                                                <Button
                                                AutomationProperties.Name="Group Title"
                                                Style="{StaticResource TextPrimaryButtonStyle}">
                                                    <StackPanel Orientation="Horizontal">
                                                        <Image Name="companyIcon" Source="{Binding CompanyLogo}" Height="135" Width="135" VerticalAlignment="Center"  Stretch="Uniform"/>
                                                    </StackPanel>
                                                </Button>
                                            </Border>
                                            <StackPanel Grid.Column="0" Width="200">
                                            </StackPanel>
                                            <StackPanel Grid.Column="2" Width="200">
                                            </StackPanel>
                                        </Grid>
                                    </DataTemplate>
                                </GroupStyle.HeaderTemplate>
                                <GroupStyle.Panel>
                                    <ItemsPanelTemplate>
                                        <VariableSizedWrapGrid />
                                    </ItemsPanelTemplate>
                                </GroupStyle.Panel>
                            </GroupStyle>
                        </GridView.GroupStyle>

    This is my header template

    19karabo91

    Monday, August 18, 2014 10:03 AM
  • Ok, I understand, you are working for GridView group header but not GridView header.

    See a similar question: http://stackoverflow.com/questions/12111619/change-gridview-header-placement

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by 19karabo91 Monday, August 18, 2014 10:25 AM
    Monday, August 18, 2014 10:13 AM
    Moderator
  • Thanks for the link i'll  try that .thank a lot for your help

    19karabo91

    Monday, August 18, 2014 10:26 AM