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

  • Home
  • SEARCH
  • 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 7678235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:35:54+00:00 2026-05-31T17:35:54+00:00

I have a listview <ListView Name=listView2> <ListView.View> <GridView> <!– First Column –> <GridViewColumn Width=105

  • 0

I have a listview

 <ListView Name="listView2">
        <ListView.View>
            <GridView>
                <!-- First Column -->
                <GridViewColumn Width="105" Header="ID">
                    <GridViewColumn.CellTemplate>
                        <DataTemplate>              
                            <StackPanel>    
                                      <!-- here is the event xID_Loaded -->    
                                <TextBox Loaded="xID_Loaded" Text="{Binding ID}"></TextBox>
                                <Popup Height="Auto"  Width="100" IsOpen="True" >
                                    <ListView Margin="2">
                                    </ListView>
                                </Popup>
                            </StackPanel>
                        </DataTemplate>
                    </GridViewColumn.CellTemplate>
                </GridViewColumn>

                <!-- Second Column -->
                <GridViewColumn Width="185" Header="Description">
                    <GridViewColumn.CellTemplate>
                        <DataTemplate>
                            <TextBox Text="{Binding Description}" ></TextBox>
                        </DataTemplate>
                    </GridViewColumn.CellTemplate>
                </GridViewColumn>
               etc...

Anyways that listview is binded to an observable collection. I use the Loaded=”xID_Loaded” event on the column to initialize the popup control everytime I add a new row to the listview.

Therefore In my code behind I have:

private void xID_Loaded(object sender, RoutedEventArgs e)
{
    // sender is the textbox

    // I can get the popup relative to the sender
    var stackPanel = (StackPanel)(((Control)sender).Parent);
    var popup = return (Popup)sp.Children[1];

    // every time window moves I want to reset the location
    // of the popu by doing:
    this.LocationChanged += (a, b) =>
    {
        popup.IsOpen = false;   // this will ensure that the popup moves with the control
        popup.IsOpen = true;
    };

   // some more code to initialice the popup
   // ...

Now I want to have a method called ResetAllPopups() where that method will reset all popups. in case someone scrolls or for watever reason I want to reset all popus.

I know I will be able to solve this problem by:

iterating through the listviewitems in the listview finding the popup control with VisualTreeHelper then reset each popup that is found.

I think it will be nicer if I could find all the events that are subscribed to this.LocationChanged event handler. How can I execute all the events that are subsribed to the this.LocationChanged event just as if I where to change the location of the window?

  • 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-05-31T17:35:55+00:00Added an answer on May 31, 2026 at 5:35 pm

    You think too UI-centric, just bind the IsOpen to your items, then iterate over them, no need to get a Popup instance.

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

Sidebar

Related Questions

I have the following ListView : <ListView Name=TrackListView> <ListView.View> <GridView> <GridViewColumn Header=Title Width=100 HeaderTemplate={StaticResource
I have the follwoing listview in my xaml: <ListView Name=listView1> <ListView.View> <GridView> <GridViewColumn Width=Auto
I have the following GridView : <ListView Name=TrackListView ItemContainerStyle={StaticResource itemstyle}> <ListView.View> <GridView> <GridViewColumn Header=Title
I have the following code in xaml: <ListView Name=listView1 IsSynchronizedWithCurrentItem=True > <ListView.View> <GridView> <GridViewColumn
A ListView with Datatemplate in GridViewColumn: <ListView Name =LogDataList IsSynchronizedWithCurrentItem=True ItemsSource={Binding LogDataCollection} Background=Cyan> <ListView.View>
So I have this code and I can't use the bindings! <ListView.View> <GridView> <GridViewColumn
This is the xaml of listview <ListView Grid.Column=1 Height=auto Name=ListView1 Width=auto AllowDrop =True >
It seems that android has enforced that a listview must have the name android:id=@android:id/list,
I have a listview with a DataTemplate that has a ComboBox. I want the
Introduction I have a ListView and want to format only the second column. The

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.