473,386 Members | 1,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

listview subitem

Hello.
I have one question
I make Listview with 4 columns.
And I want add text to to column 2,3,4.
With listview1->Items->add ("Text") I can add text only to first column.
In Visual basic.NEt I can write listview1.Items(x).Subitem(number
column).Add ("Text"). Is something like this in VC.NET?
Thanks for answers.

Nov 17 '05 #1
6 6830
>I have one question
I make Listview with 4 columns.
And I want add text to to column 2,3,4.
With listview1->Items->add ("Text") I can add text only to first column.
In Visual basic.NEt I can write listview1.Items(x).Subitem(number
column).Add ("Text"). Is something like this in VC.NET?


If you're working in managed C++ with WinForms it'll be essentially
the same.

If you're using native SDK you use the LVM_SETITEMTEXT message,
similarly for MFC you use the CListCtrl::SetItemText method.

Dave
Nov 17 '05 #2
But it's not the same, How can I add Subitem?
Thanks
"David Lowndes" <da****@example.invalid> wrote in message
news:5r********************************@4ax.com...
I have one question
I make Listview with 4 columns.
And I want add text to to column 2,3,4.
With listview1->Items->add ("Text") I can add text only to first column.
In Visual basic.NEt I can write listview1.Items(x).Subitem(number
column).Add ("Text"). Is something like this in VC.NET?


If you're working in managed C++ with WinForms it'll be essentially
the same.

If you're using native SDK you use the LVM_SETITEMTEXT message,
similarly for MFC you use the CListCtrl::SetItemText method.

Dave

Nov 17 '05 #3
>But it's not the same, How can I add Subitem?

What's not the same?

You need to explain your situation and problem more.

Dave
Nov 17 '05 #4
OK. I can add subItem to listview, in listview I Have 3 columns.
In first column will be Name, in second colun will be Surname, And in three
column will be Address.
How can I add : Peter~ Blank~ Main street 22
Thanks
"David Lowndes" <da****@example.invalid> wrote in message
news:g5********************************@4ax.com...
But it's not the same, How can I add Subitem?


What's not the same?

You need to explain your situation and problem more.

Dave

Nov 17 '05 #5
I repair my previous Post.
How can add Item with 2 subitems to listview, in listview I Have 3 columns.
In first column will be Name, in second column will be Surname, And in third
column will be Address.
How can I add : Peter (Name)~ Blank(Surname)~ Main street 22(Adress) to
Thanks

In visual basic.net I can Write
Listview1.Items(1).Subitems.add("Peter")
Listview1.Items(1).Subitems.add("Blank")
Listview1.Items(1).Subitems.add("Adress")

And When I want get Text of Item in second row and second Column
I can write Listview.Items(1).Subitems(1).Text.

How Can I write this 2 things in Visual C++.NEt in Managed Application.
BEcaause I couldn't write Listview1->Items(1)->
Thanks.
Nov 17 '05 #6
>In visual basic.net I can Write
Listview1.Items(1).Subitems.add("Peter")
Listview1.Items(1).Subitems.add("Blank")
Listview1.Items(1).Subitems.add("Adress")

And When I want get Text of Item in second row and second Column
I can write Listview.Items(1).Subitems(1).Text.

How Can I write this 2 things in Visual C++.NEt in Managed Application.
BEcaause I couldn't write Listview1->Items(1)->


It'll be something like:

Listview1->Items[1]->Subitems->add("Adress")

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
Nov 17 '05 #7

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

Similar topics

2
by: John Lauwers | last post by:
I know you can edit the first column of the listview control, is there a way to edit the second and/or the other columns? greets John
6
by: Richard | last post by:
Hi. I use a ListView to display data in tabular form. Each ListView row corresponds to a data record. The ListView Item of the record is the record key or code. Each SubItem in that row...
1
by: andrewcw | last post by:
The clcik event on the ListView control seems to trigger off the item level ( the first column ). I would like to be able to trap the click event on a particular subitem ( a specific column's row...
0
by: Andrew | last post by:
If item is a ListViewItem and str is a string, why do the following two lines not have the same effect ? item.SubItems.Add(new ListViewItem.ListViewSubItem()).Text = str;...
3
by: Rob Richardson | last post by:
Greetings! I am attempting to display data in tabular form using a ListView control in detail mode. This is for a program I originally wrote in VB6. In VB6, I would add an item to the...
6
by: Jack | last post by:
Hello, I've noticed through searching this group's previous posts that one can get the item the mouse is over in a listview control but I did not see how to get the subitem the mouse is over. Is...
0
by: Lucky | last post by:
hi guys, i'm looking for a soultion that helps me to show the subitem text of the listview control in the tooltip when the mouse pointer hovers on the subitem. i've found on solution, according to...
5
by: Martin Horn | last post by:
Hi all, I want to implement a listview with editable subitems and I assume the easiest way is to overlay a textbox over the item to be edited. With this in mind I have come up with: Using...
10
by: Adam Honek | last post by:
This is probably a silly question but oh well, I can't find the answer looking via code. Having an imagelist already, how does one set an icon for a list view's sub items? I'm using the code...
1
by: James | last post by:
Hi All, I have an ownerdraw ListView control. I'm trying to use an ownerdrawn ListView control to draw and display images in the second column of a listview which is set to detail view. I...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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...

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.