PC Review


Reply
Thread Tools Rate Thread

Build ListViewItem.Content

 
 
Eternal Snow
Guest
Posts: n/a
 
      25th Dec 2007
Hi all.

I'm using ListView in WPF file.

I added 3 column in a view (ListView.View = AGridView, with 3 column in the
view).

ListViewItem item = new ListViewItem();
item.Content = new String[] { "1", "2", "3" };
listView.Items.Add(item);

The result display is:
String[] Array String[] Array String[] Array

So, how can I do that in order to get:
1 2 3

Thanks.

 
Reply With Quote
 
 
 
 
Eternal Snow
Guest
Posts: n/a
 
      25th Dec 2007
ListView is defined in XAML:
<ListView Name="listView" />

Columns are added by code (not in XAML):
GridView view = new GridView();
GridViewColumn c1 = new GridViewColumn();
c1.Header = "ID";
view.Columns.Add(c1);
GridViewColumn c2 = new GridViewColumn();
c2.Header = "Name";
view.Columns.Add(c2);
GridViewColumn c3 = new GridViewColumn();
c3.Header = "Description";
view.Columns.Add(c3);
listView.View = view;

Create Item:
ListViewItem item = new ListViewItem();
item.Content = new string[] { "1", "2", "3" };
listView.Items.Add(item);

only an empty line with no data can be found in that listview.
 
Reply With Quote
 
Eternal Snow
Guest
Posts: n/a
 
      25th Dec 2007
Sorry, mistake.

The last words of 1st reply should be:

Only an item like
String[] Array String[] Array String[] Array
can be found in that listview.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DLL Files with Build Action Content not deployed Michael Lang Microsoft Dot NET Compact Framework 2 23rd Dec 2005 01:33 AM
Use Cell Content to Build Link flattire00101 Microsoft Excel Worksheet Functions 1 17th Jun 2005 06:40 PM
Copy content files to build direcotry in VB.NET? Samuel R. Neff Microsoft VB .NET 1 14th Apr 2005 05:40 PM
ListView.Items.Add(ListViewItem) returns ListViewItem reference instead of the Index as integer? Eric Newton Microsoft Dot NET Framework Forms 3 8th Jan 2004 10:56 AM
Howto copy content files to build directory dansan Microsoft Dot NET Framework 4 6th Oct 2003 04:59 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:45 PM.