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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T18:36:00+00:00 2026-05-15T18:36:00+00:00

I have a application im working on that uses the Jabber Libraries to connect

  • 0

I have a application im working on that uses the Jabber Libraries to connect to a jabber Server and receive contacts etc.

I have buit all login system and interface for the chat but now im working on how to Bind the data for the contacts to the ListView

I have a function that is called when a contact comes online such, See Below

//AppController.cs
public void XmppConnection_OnRosterItem(Object Sender, RosterItem RosterItem)
{
    if (LoginWindow.ActiveForm.InvokeRequired)
    {
        LoginWindow.ActiveForm.BeginInvoke(
           new XmppClientConnection.RosterHandler(XmppConnection_OnRosterItem),
              new object[] { Sender, RosterItem}
        );
        return;
    }
    //UPDATE HERE
}

The idea is to have a class such as ContactList so that when the above function is called i can go ContactList.AddRoster(Roster);

What i need to know is how do I create a custom list class and then bind it to the the Form witch holds the ListView element

And if possible set an update interval to recompile the ListVeiw?

Hope you guys can help me


Edit:

If I could have 2 classes one for the individual contact and one to hold the collection like so:

Contact C = new Contact(Roster.Name,Roster.Jid,Roster.Group);
ContactList.Add(C);

This as well would be good.

  • 1 1 Answer
  • 1 View
  • 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-15T18:36:01+00:00Added an answer on May 15, 2026 at 6:36 pm

    You could create a Contact class the just create a List of Contacts

    List<Contact> ContactList=new List<Contact>();
    ContactList.Add(Roster);
    

    How to Bind ListView to List
    http://www.vistax64.com/avalon/615-how-bind-listview-list-mystruct.html

    Not sure about the update interval though. Attach it to a certain event and check the time in between maybe? MouseMove (Performance Cost?)

    Anyone else have any ideas?

    EDIT:

    class ContactList:List<Contact>
        {
            public ContactList()
            {
    
            }
        }
    

    You shouldn’t need to add anything to this class

    class Contact
        {
            public string _Name;
            public string _Jid;
            public string _Group;
            public Contact()
            {
                _Name = "Test";
                _Jid = "One";
                _Group = "Two";
            }
            public Contact(string Name, string Jid, string Group)
            {
                _Name = Name;
                _Jid = Jid;
                _Group = Group;
            }
            public override string ToString()
            {
                return _Name+" "+_Jid+" "+_Group;
            }
    
        }
    

    Overiding the ToString function allows you easier control over what is displayed in the listbox

    public Form1()
            {
                InitializeComponent();
                ContactList C = new ContactList();
                C.Add(new Contact("Name","Jid","Group"));
                C.Add(new Contact());
                C.Add(new Contact("Test","2","Something"));
                for (int i = 0; i < C.Count; i++)
                {
                    listView1.Items.Add(C[i].ToString());
                }
            }
    

    Let me know if this works for you.

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

Sidebar

Related Questions

I have an application I'm working on that uses two third party libraries, each
I am thinking of working on a Rails application that uses PostgreSQL. I have
I have an application that uses Swing. The display I am working on, uses
So I have been working on this phone gap application that uses jquery-mobile. Recently,
I am working on a Silverlight application that uses WCF. I need to have
I have a working web application that uses username/password SpringSecurity configuration. Now I want
I have a web application that I am currently working on that uses a
I have a working application that establishes an SSL connection to a server. The
I am working on a pyramid web application that uses SQLAlchemy. I have a
I am working on building an iPhone application that uses an external server to

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.