First off I don't want to get your hopes up so I'm going to tell you now that the ListView doesn't support databinding. Below I explain what databinding is. Here is my reference http://forums.microsoft.com/msdn/ShowPost.aspx?siteid=1&PostID=11680
There is a project on codeproject.com that created a ListView that you can databind to, but I haven't used it. http://www.codeproject.com/KB/list/ListView_DataBinding.aspx There is a concept in WinForms that does what you are talking about. It's called databinding. In simplicity, it allows you to setup multiple UI components to point to the same data object. This could be an object in a collection of objects (complex databinding), or just a single object. The benefit is once all the bindings are setup, the entire UI is updated when you tell it to look at a different object. A UI control that does support databinding is called the DataGridView. It's a really powerful control, and is built to make it easy for both the developer and user to view, add, delete, and edit data. Most say it's really ugly and that the ListView is very pretty. By default the GridView is ugly, but it allows you to change the colors and look of EVERYTHING. Simply changing the BackgroundColor property to something like White makes it look a million times better. Good luck On Sun, Sep 7, 2008 at 4:47 AM, Sebastian <[EMAIL PROTECTED]> wrote: > > Hi all, > > I am new to C# and I could not find an answer to a problem concerning > list views (probably, because I did not search for the right > keywords). > > I have two listviews on different tabPages of a tabControl in a > Windows Forms form. I would like to having them shown exactly the same > content. > > One way to do this, is to change the items of both listviews at a time > upon a change in the underlying data. So I could add the same data to > both listViews by doing: > > listView1.Items.Add(listviewitem) > listView2.Items.Add(listviewitem) > > I was wondering, if there is a more efficient way. Ideally I would > like to be able to set a pointer (or something similar) from both > listViews to one object (e.g. a ListViewItemCollection) containing the > data, which I want to present in the views. Then I would only change > that object and both ListViews would show the updated data. > > Could somebody be so kind to point me to a way to do this? Many > thanks! > > Cheers, Sebastian > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://cm.megasolutions.net/forums/default.aspx -~----------~----~----~----~------~----~------~--~---
