473,511 Members | 12,747 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

WPF: ListView help required

I have a Windows appliction that I want to turn into a WPF application (as a
proof of concept).

However, I have encountered a problem with the ListView object and I can't
find any suitable help files...

There are two problems...

Problem 1:

The following *code* demonstrates what is occuring in my Windows
application.

' Create an array of ListViewItems
Dim listViewItemsArray() as ListViewItem

' Populate this array - I won't go into the code here, but I end up with an
array of list view items....

' Add the array of list view items to the listView
myForm.lvPeople.Items.AddRange(listViewItemsArray)

In the WPF application, the ListView object doesn't have the .AddRange
method.

Problem 2:

I want to create a list view that has two columns, one with "firstname" and
the second with "surname".

In the Windows application, I have the following code (snippets)
Dim lvItem as new ListViewItem
With lvItem
.Text = fName
.SubItem.Add(sName)
End With

I then add this ListViewItem to my array and add it to the ListView as
previously described.

However, in the WPF application, the ListViewItem doesn't have a "Text"
property anymore, it has "Content". I therefore set "Content" to be the
fName. There doesn't seem to be any where to add the SubItems, so at a bit
of a dead-end here.

Any help on either/both these problems would be most appreciated.

Many thanks

Griff

Feb 12 '08 #1
0 1296

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2604
by: Martin Streller | last post by:
Hello, The code below represents a simple ownerdrawn, Listview class in C#. Its purpose is to avoid the flicker of the MS ListView. So I can't fall back to their one. Does anybody know why I...
4
9697
by: Paddy | last post by:
How do I select a subitem from a listview after clicking on the first column? Couldn't find it in MSDN. Thank you. Paddy.
0
3538
by: ER | last post by:
Hi Guys Started having a play with WPF and need some direction with a grid. I am trying to build a list of products in a grid view with combox boxes as column headers that allow filtering and...
0
1155
by: bj7lewis | last post by:
WPF doesn't have ListViewSubItemCollection equall just ListViewItem that takes a content object but is arranged & clipped to the last cell in the column of given row.... I have a C# .NET 1.1...
0
1770
by: Griff | last post by:
I have a Windows appliction that I want to turn into a WPF application (as a proof of concept). However, I have encountered a problem with the ListView object and I can't find any suitable help...
6
4255
by: John | last post by:
Hi If I have a choice of WPF or Windows Form versions of a control which one should I purchase? Thanks Regards
0
4583
by: =?Utf-8?B?SWdvcg==?= | last post by:
Hi everyone! I have some strange behavior of ListView control in WPF. We are developing application in C#. I created ListView with some items and set SelectedIndex to some index in the...
3
1266
by: Just_a_fan | last post by:
I have been through two books where they talk about the (almost) parallel control set for WPF and VB. They go through the small difference and talk about everything going on a form but what they...
4
7443
by: Brandon | last post by:
HI all, I am working on a WPF listview that get items through the XMLDataProvider and making a listview with two actual columns and in both CellTemplete XAML in a grid bind more than one snippet...
0
1858
by: Brandon | last post by:
Hi there... I got a WPF project that I am trying to select a ComboBoxItem in a ComboBox based on a string from the selected ListView item in the project... This ComboBox is unbound now and the...
0
7251
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7148
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7367
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7430
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7089
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5673
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1581
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
451
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.