locked
Floating or Overlaying the content of one child over another child in VirtualizingStackPanel.

    Question

  • Hi

    am having an ItemsControl (naming this as OuterItemsControl for ref) with orientation as vertical. ItemTemplate of this ItemsControl is another ItemsControl (naming this as RowItemsControl) with Horizontal Orientation.

    VirtualizingStackPanel is the ItemsPanel for both ItemsControl.

    ItemTemplate of the RowItemsControl is like below.

    <Border Height="100" BorderBrush="White" 
      VerticalAlignment="Stretch" Width="300"                    BorderThickness="2">
    
            <Grid>            
                <StackPanel Grid.Row="1" :Name="programPanel">
                    <TextBlock  Text="{Binding Text1}" HorizontalAlignment="Left"/>
    
                    <TextBlock Text="{Binding Text2}"  HorizontalAlignment="Left"  FontSize="15"/>                                                                 
                </StackPanel>
            </Grid>
    
    </Border>

    I want the content of FirstChild in RowItemsControl overlay(float) to next child, if the text content of next child is empty.

    Suggest a way to achieve this requirement, if you want more details then i will explain the scenario deeply.

    Thanks,

    Santyy



    Santyy

    Monday, March 3, 2014 3:29 PM

Answers

  • Found a way to achieve my requirement.

    we can overlay|float the content of one child over another child by setting the right margin in negative values like below.

    Margin=0,0,-15,0;

    i have set the right margin based the text content of next child in VirualizingStackPanel.

    Santyy


    Santyy

    Wednesday, April 9, 2014 11:07 AM

All replies

  • Yes, please explain more as I don't get it.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Monday, March 3, 2014 8:47 PM
    Moderator
  • Found a way to achieve my requirement.

    we can overlay|float the content of one child over another child by setting the right margin in negative values like below.

    Margin=0,0,-15,0;

    i have set the right margin based the text content of next child in VirualizingStackPanel.

    Santyy


    Santyy

    Wednesday, April 9, 2014 11:07 AM