Hi all,
I know that I can get the value of a particualar column in a list view by
something like this:
lvwRoster.SelectedItems(0).SubItems(2).Text
However, is it possible to get the value by column name? In vb.net you can
assign a column name for each column, but I don't know where I can use
it.... any idea?
Thx~~~
Kay 5 2195
Kay,
A listview is not a datatable (dataview).
A listview has headers but AFAIK no column names,
Cor
"Kay" <kk@kk.com.kkschreef in bericht
news:eH**************@TK2MSFTNGP02.phx.gbl...
Hi all,
I know that I can get the value of a particualar column in a list view by
something like this:
lvwRoster.SelectedItems(0).SubItems(2).Text
However, is it possible to get the value by column name? In vb.net you
can assign a column name for each column, but I don't know where I can use
it.... any idea?
Thx~~~
Kay
It has Cor...in a listview's property, it has a "columns" collection, in
each column you can assign a name there, it also where you can assign the
column Text.... am I correct?
Kay
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:eX**************@TK2MSFTNGP03.phx.gbl...
Kay,
A listview is not a datatable (dataview).
A listview has headers but AFAIK no column names,
Cor
"Kay" <kk@kk.com.kkschreef in bericht
news:eH**************@TK2MSFTNGP02.phx.gbl...
>Hi all,
I know that I can get the value of a particualar column in a list view by something like this: lvwRoster.SelectedItems(0).SubItems(2).Text
However, is it possible to get the value by column name? In vb.net you can assign a column name for each column, but I don't know where I can use it.... any idea?
Thx~~~
Kay
Kay,
But AFAIK does by instance a datatable column describe a datarow item.
(Therefore you cannot simple move a datarow to another datatable).
A listview column describes only a header column not a
listviewitemcollection item.
Cor
"Kay" <kk@kk.com.kkschreef in bericht
news:ej****************@TK2MSFTNGP04.phx.gbl...
It has Cor...in a listview's property, it has a "columns" collection, in
each column you can assign a name there, it also where you can assign the
column Text.... am I correct?
Kay
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:eX**************@TK2MSFTNGP03.phx.gbl...
>Kay,
A listview is not a datatable (dataview). A listview has headers but AFAIK no column names,
Cor
"Kay" <kk@kk.com.kkschreef in bericht news:eH**************@TK2MSFTNGP02.phx.gbl...
>>Hi all,
I know that I can get the value of a particualar column in a list view by something like this: lvwRoster.SelectedItems(0).SubItems(2).Text
However, is it possible to get the value by column name? In vb.net you can assign a column name for each column, but I don't know where I can use it.... any idea?
Thx~~~
Kay
On Tue, 22 Aug 2006 13:34:58 +1000, "Kay" <kk@kk.com.kkwrote:
>Hi all,
I know that I can get the value of a particualar column in a list view by something like this: lvwRoster.SelectedItems(0).SubItems(2).Text
However, is it possible to get the value by column name? In vb.net you can assign a column name for each column, but I don't know where I can use it.... any idea?
Thx~~~
Kay
The DataGridView control, unbound, can be configured to look indentical to a ListView, Detail View,
and will give you the functionality you are looking for.
Gene
Kay wrote:
Hi all,
I know that I can get the value of a particualar column in a list
view by something like this:
lvwRoster.SelectedItems(0).SubItems(2).Text
However, is it possible to get the value by column name? In vb.net
you can assign a column name for each column, but I don't know where
I can use it.... any idea?
Thx~~~
Kay
Kay,
If you set the Name property on the ListViewItem and the ListViewSubItems as you add them into the ListView you can then access the
columns by name. For example, if you set the ListViewItem.Name to "FirstName" then you can access the column as:
lvwRoster.SelectedItems(0).SubItems("FirstName").T ext
I hope this helps.
--
Al Reid This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: andrewcw |
last post by:
I have a simple winform with the following code.
But although I can read back the info, the display fails
to provide the text or the cell background color changes.
private void ListViewBroke()...
|
by: J_Max |
last post by:
Hello,
This might be a really easy question, but... I am
developing a simple Smart Device application that uses a
listview. I have a function that adds a item to the
listview - code is below. I...
|
by: Dave Y |
last post by:
I am a newbie to C# and am having trouble trying to override a ListView
property method. I have created a new class derived from the Forms.Listview
and I cannot figure out the syntax to override...
|
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,...
|
by: Derck |
last post by:
SORRY, for the crosspost, but I think I posted it in the wrong group!
Hello all,
I have a question.. I am tying to make a global listview class where other
listviews in my application points...
|
by: J L |
last post by:
When I fill a listview, I resize the columns to fit the data. I need
to know if the data will fit vertically or if there will be a vertical
scroll bar. I need to know this so I can allow for it on...
|
by: Chris |
last post by:
Hi all,
I posted the following in microsoft.public.dotnet.framework.windowsforms
but it seems that group has little traffic.
Hi all,
I have a listview box which is populated from methods of...
|
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.
...
|
by: =?Utf-8?B?THluYkBtcy5jb20=?= |
last post by:
I have a executable winforms application I would like to change.
I use quite a number of listview controls in my main form.
I dump about 15 columns of data into a couple of listviews.
This data...
|
by: Mark Olbert |
last post by:
How do I get the DataPager and ListView to play nice together when I use a custom datasource?
In my webpage, I use linq to pull data from a SqlServer database and assign the resulting...
|
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$) {
}
...
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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...
|
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,...
|
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...
| |