473,385 Members | 1,942 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,385 software developers and data experts.

ListView Problem

I'm having a rather tedious problem with the listview control in visual
basic.net

I am trying to achive two simple procedures, I thought :)

1. I have only one column populated but still there is an extra empty column
listed to the right of the header. Is there no way to specify that I only
want a single column. Or is there a way to hide that unpopulated extra
column that I don't want.

2. How exactly does one reference the text or value of the selected sub
item. I would like to pass this text in my case to a function but I'm unable
to get it.

Sorry for the I'm sure simple questions, but I have googled my brains out
and been over the docs and can find nothing to point me in the right
direction.

Thanks in advance

--
Hunter Kirk
Twilight Technologies, L.L.C.
hu****@twilightech.com
http://www.twilightech.com
Nov 20 '05 #1
4 1767
k well I kinda hacked out a solution for hiding the column buy just setting
my single column's width to that of the list view. seems kind of a hack way
to do things, especially with resizing seems I have to update the width of
the column with the listview anytime the listview is resized. now if I can
just get that darned text from the selected subitem :)
"Hunter Kirk" <hu****@twilightech.com> wrote in message
news:vp************@corp.supernews.com...
I'm having a rather tedious problem with the listview control in visual
basic.net

I am trying to achive two simple procedures, I thought :)

1. I have only one column populated but still there is an extra empty column listed to the right of the header. Is there no way to specify that I only
want a single column. Or is there a way to hide that unpopulated extra
column that I don't want.

2. How exactly does one reference the text or value of the selected sub
item. I would like to pass this text in my case to a function but I'm unable to get it.

Sorry for the I'm sure simple questions, but I have googled my brains out
and been over the docs and can find nothing to point me in the right
direction.

Thanks in advance

--
Hunter Kirk
Twilight Technologies, L.L.C.
hu****@twilightech.com
http://www.twilightech.com

Nov 20 '05 #2
You seem to have a "catch 22" situation. My
understanding of ListView columns is that you need one
column for each sub-item, in addition to the main item's
column.

Nov 20 '05 #3
by sub item I mean the items under the single column, is that the correct
verbage ?

basically I just want to grab the selected index of the item or subitem ?
not sure which to call it :)

I've tried doing this by using e.Index passed to the
listview.seleteditems(e.Index).text but alas e.Index isn't supported the way
I'm calling. I maybe on the wrong path so if anyones got an idea it would be
very welcome.

"Jim Rogers" <jc*******@shaw.ca> wrote in message
news:06****************************@phx.gbl...
You seem to have a "catch 22" situation. My
understanding of ListView columns is that you need one
column for each sub-item, in addition to the main item's
column.

Nov 20 '05 #4
Entries in the first column of a ListView are called
items. Any other columns contain sub-items to the
corresponding item in the first column.

I believe the following code example is what you are
trying to get:

Private Sub ListView1_Click( _
ByVal sender As Object, _
ByVal e As System.EventArgs) _
Handles ListView1.Click

Dim collItems As ListView.SelectedListViewItemCollection
collItems = Form1.ListView1.SelectedItems
Dim intItemIdx As Int32 = collItems.Item(0).Index
Nov 20 '05 #5

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

Similar topics

0
by: Steph. | last post by:
I use a ListView in a form to display Data from an SQL db. My problem is that I can fill the listview in less than a second when I show the form AFTER filling the listview, but I take 35...
15
by: Wiktor Zychla | last post by:
today we've found a critical issue regarding the ListView from Windows.Forms. it was confirmed on several machines with Win2K and XP. here's the problem: create a ListView with about 50000 rows....
0
by: Sérgio Almeida | last post by:
Greetings I have a problem using listview control. Well, I belive that this is not realy a problem, but it's consuming me precious time. Here is the scenario (an example of my problem). I...
3
by: MikeY | last post by:
Hopefully someone can help me on this. I am using C#, making Windows forms. I have created a listView with checkbox's. I have enabled the checkboxes under the properties, and all the data,...
4
by: firefox | last post by:
Hola Foro!, tengo una rutina que permite agregar varios elementos o items de una sola vez en un ListView. Lo que sucede es que en el momento que se añaden los items al ListView se pone todo blanco,...
4
by: Pucca | last post by:
How can I tell a mouse right clicks over a listview item that's in a container panel. I only want to display a popup menu if the user right click the mouse over an item on the Listview. I don't...
3
by: Martin Panggabean | last post by:
Hello All, I've kind a logic problem ... I want to fill the listView control in VB.NET with data in my mySql table using Datareader object component. But It seems that the way of how listView...
12
by: garyusenet | last post by:
I have had no replies to my previous post so perhaps I didn't write it good enough. Please excuse new thread but i wanted to break from the last thread hopefully this thread will be better. ...
4
by: Brian Gaze | last post by:
I have created a ListView control and have bound this to a datasource. Within the ItemTemplate of the ListView I have added another ListViewControl which is databound in the code behind. The idea...
2
by: =?Utf-8?B?UGhpbGlw?= | last post by:
I am attempting to insert a simple record with LinqDataSource from a ListView, however I always get a message saying "....LinqDataSource 'dataSource' has no values to insert. Check that the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
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.