Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7975347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:37:10+00:00 2026-06-04T08:37:10+00:00

I have a listview: <ListView Name=SelectedFeeds> <ListView.ItemContainerStyle> <Style TargetType={x:Type ListViewItem} BasedOn={StaticResource {x:Type ListViewItem}}> <Style.Triggers>

  • 0

I have a listview:

<ListView Name="SelectedFeeds">
    <ListView.ItemContainerStyle>
        <Style TargetType="{x:Type ListViewItem}" 
               BasedOn="{StaticResource {x:Type ListViewItem}}">
            <Style.Triggers>
                 <Trigger Property="IsSelected" Value="True">

                 </Trigger>
            </Style.Triggers>
        </Style>
    </ListView.ItemContainerStyle>
    <ListView.ItemTemplate>
        <DataTemplate>
            <StackPanel Orientation="Vertical" Name="panel">
                <TextBlock x:Name="Title" FontSize="24" 
                           Text="{Binding Title, IsAsync=True}" TextWrapping="Wrap" />
                        <Label x:Name="PubDate" FontSize="10" 
                               Content="{Binding Path=PubDate, IsAsync=True}" />
                        <TextBlock my:HtmlParser.HTMLText=
                                   "{Binding Path=Description, IsAsync=True}" 
                                   TextWrapping="Wrap" 
                                   Width="{Binding ElementName=panel, 
                                   Path=ActualWidth}" Height="0" />
             </StackPanel>
        </DataTemplate>
    </ListView.ItemTemplate>
</ListView>

There is a TextBlock in DataTemplate with large height.

At start I’m setting height of this textblock to “0” and when ListViewItem is selected, I need to set that height to “Auto”.

This is probably can be done with triggers, but I can’t figure it out.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T08:37:11+00:00Added an answer on June 4, 2026 at 8:37 am

    For a trigger approach, use it in the DataTemplate.

    <ListView Name="SelectedFeeds">
        <ListView.ItemTemplate>
            <DataTemplate>
                <StackPanel Orientation="Vertical" Name="panel">
                    <TextBlock x:Name="Title" FontSize="24" 
                               Text="{Binding Title, IsAsync=True}" TextWrapping="Wrap" />
                            <Label x:Name="PubDate" FontSize="10" 
                                   Content="{Binding Path=PubDate, IsAsync=True}" />
                            <TextBlock x:Name="TextHolder"
                                       my:HtmlParser.HTMLText=
                                       "{Binding Path=Description, IsAsync=True}" 
                                       TextWrapping="Wrap" 
                                       Width="{Binding ElementName=panel, 
                                       Path=ActualWidth}" Height="0" />
                 </StackPanel>
                <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding IsSelected, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListViewItem}}}" Value="True">
                        <Setter TargetName="TextHolder" Property="Height" Value="123"/>
                    </DataTrigger>
                </DataTemplate.Triggers>
            </DataTemplate>
        </ListView.ItemTemplate>
    </ListView>
    

    Note the x:Name property on the TextBlock.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It seems that android has enforced that a listview must have the name android:id=@android:id/list,
I have ListView that has the following EditItemTemplate: <EditItemTemplate> <tr style=> <td> <asp:LinkButton ID=UpdateButton
Hi i have a listview with diffrent columns ID, Name, Zipcode, City, Country, Phone,
I have a ListView that has two columns, one for a zone name and
I have a ListView similar to this: Name | Pass | Proxy | Keyword
I have a ListView and a EditText. I want to be search the name
I have a ListView with the columns 'Name', 'Expected', 'Total', and I want to
I have a ListView with 3 columns (User Name, Active, and Group) The ItemsSource
Now I have ListView and in one column has: <GridViewColumn CellTemplateSelector={StaticResource messagerEditorTemplateSelector}/> And everything
I have a listview with 4 columns - Name, Extension, Size and Location. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.