I have create a list view which contains 4 columns
I write the code below:
ListViewBookRecord.Items.Add(( dr["bookname"].ToString()));
ListViewBookRecord.Items.Add(( dr["authorname"].ToString()));
ListViewBookRecord.Items.Add(( dr["booktype"].ToString()));
ListViewBookRecord.Items.Add(( dr["price"].ToString()));
Then all the data fill at the first columns
I want the different data fill at the different column
How should I do in order to put the data at the different column?
Thank You
|
Go4Expert Founder
|
![]() |
| 12Jun2006,19:24 | #2 |
|
You have to add them as subitems of the currently added item.
|
|
Contributor
|
|
| 12Jun2006,19:28 | #3 |
|
Yes,
|
|
Contributor
|
|
| 12Jun2006,19:30 | #4 |
|
Yes,I have tried this:
ListViewBookRecord.SubItems.Add(( dr["ID"].ToString())); But it say that 'System.Windows.Forms.ListView' does not contain a definition for 'SubItems' |
|
Go4Expert Founder
|
![]() |
| 13Jun2006,14:56 | #5 |
|
Here is the code for you to add sub items to the list view in C#
Code: C#
|
|
Contributor
|
|
| 13Jun2006,15:46 | #6 |
|
Thank You
|

