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 7925997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T18:32:46+00:00 2026-06-03T18:32:46+00:00

The ListViewItem.ListView property will automatically be set after being added to a owner ListView.

  • 0

The ListViewItem.ListView property will automatically be set after being added to a owner ListView. However the ListViewItem.ListView property has no setter.

ListViewItem item = new ListViewItem(); // item.ListView == null here.
listView.Items.Add( item ); // item.ListView != null where no setter.

I’d like to know the implementation of ListViewItem.ListView get property.
What a private field is set inside the ListView.Items.Add() method? And how?
I’m trying craeting similar class relationship as a relationship between ListView and ListViewItem.

Thanks much for your help.

  • 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-03T18:32:55+00:00Added an answer on June 3, 2026 at 6:32 pm

    ListViewItemCollection.Add calls (indirectly) an internal method on ListViewItem:

    internal void Host(ListView parent, int ID, int index)
    {
        this.ID = ID;
        this.listView = parent;
        if (index != -1)
        {
            this.UpdateStateToListView(index);
        }
    }
    

    (you can see this code in a decompiler like Reflector or JustDecompile)

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

Sidebar

Related Questions

I added a button in a listview item, and after the button is clicked,
I have a binding for ListViewItem, which is under gridview/listview/scrollviewer. <Setter Property=IsSelected Value={Binding IsSelected}/>
I'm copying ListViewItems from one ListView to another, sth. like: foreach (ListViewItem item in
I'm using theExpression Dark WPF Theme( http://wpfthemes.codeplex.com/ ) with a ListView(view property set to
When hovering over an item in a list, how can I set a property
Maybe someone know how ListView pointer is stored/removed at ReadOnly Property ListView in ListViewItem?
I've a ListView (named ListView1). I added 4 columns (with visual editor, property Column):
I could not find any remarks on MSDN ListView.Groups Property that empty ListViewGroup will
I've got a ListViewItem that is added to a ListView, but I don't know
I have some code that does <Style TargetType=ListViewItem> <Setter Property=XX Value=true /> </Style> This

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.