473,399 Members | 4,177 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,399 software developers and data experts.

Listview

Greetings,

I would like to know how to get values from a listview with it having 5 columns. And How to insert values unto it. It's so much different than listbox. I've been doing a lot of searching but alas, no luck on finding what i am looking for. Thanks in advance.
May 31 '08 #1
5 1481
lotus18
866 512MB
Greetings,

I would like to know how to get values from a listview with it having 5 columns. And How to insert values unto it. It's so much different than listbox. I've been doing a lot of searching but alas, no luck on finding what i am looking for. Thanks in advance.
For getting values, you can try the SelectedItem. For inserting, ListItems.Add method will do. BTW, What version of vb are you using?

Rey Sean
May 31 '08 #2
CyberSoftHari
487 Expert 256MB
This link will give all about Listview
ListView Control for Visual Basic 6.0 Users
May 31 '08 #3
I'm using visual basic 6.0.


Can anybody give me a brief explanation on how to manipulate or use the listview effectively?

@Poster above me:
I've seen that page before, still i can't get what i want to achieve. Help please.
Jun 1 '08 #4
lotus18
866 512MB
I'm using visual basic 6.0.


Can anybody give me a brief explanation on how to manipulate or use the listview effectively?

@Poster above me:
I've seen that page before, still i can't get what i want to achieve. Help please.
Are you using a database? I can give you a sample code in populating items on a listview

Expand|Select|Wrap|Line Numbers
  1. SetConnection 'My Main Connection
  2.  
  3.     rs.Open "Select * From <TableName>", con, 3, 3
  4.     Listview1.ListItems.Clear
  5.     While Not rs.EOF
  6.         On Error Resume Next 'Ignores null items
  7.         With Listview1.ListItems.Add(, , rs!<PrimaryKey>, 1, 1)
  8.             .SubItems(1) = rs!<Field1>
  9.             .SubItems(2) = rs!<Field2>
  10.             .SubItems(3) = rs!<Field3>
  11.             .SubItems(4) = rs!<Field4>
  12.         End With
  13.         rs.MoveNext
  14.     Wend
Rey Sean
Jun 1 '08 #5
debasisdas
8,127 Expert 4TB
Please find some related articles here and here.
Jun 2 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Anushya | last post by:
Hi I am using Listview and inherited listview control overriding WndProc & PreProcessMessage in ListView. I need this to customize listview to display only the page the user scrolls to. Since i...
0
by: Anushya | last post by:
Hi I am using Listview and inherited listview control overriding WndProc & PreProcessMessage in ListView. I need this to customize listview to display only the page the user scrolls to. Since i...
0
by: keith | last post by:
In a ListView control (two columns), I added a few ListView items. ListView listview=new ListView(); listview.Parent=this; listview.View=View.Details; listview.Columns.Add...
7
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...
7
by: BobAchgill | last post by:
I am trying to decide which of these controls to use to implement letting my user select a full row from MyList. The MyList has several columns which would be nice to sort by at run time. The...
5
by: John Devlon | last post by:
Hi, Does anyone know how to get a value of a second column of a selected item in Listview. I've create a listview and added this code Listview.Items.Clear() Listview.Columns.Clear()...
0
by: Peter | last post by:
Hi, I have a problem with Listview using checkboxes. If i check items by code BEFORE the form is shown the Listview.Items are confused during the ItemChecked Event !!! After showing the...
2
by: Peter | last post by:
Hi, I have a problem with Listview using checkboxes. If i check items by code BEFORE the form is shown the Listview.Items are confused during the ItemChecked Event !!! After showing the...
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...
1
by: =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post by:
Hello, In my application I need to periodically remove all current items from a ListView and add a new set into it. The following abbreviated code contains the basic idea: private void...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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: 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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.