473,407 Members | 2,676 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,407 software developers and data experts.

List View Problem

Ali Rizwan
925 512MB
Hi all,

code for adding under 1st column

Expand|Select|Wrap|Line Numbers
  1. ADATA.Recordset.MoveFirst
  2.  
  3.     Do While Not ADATA.Recordset.EOF
  4.     lv.ListItems.Add 1, , ADATA.Recordset.Fields("RegNo")
  5.     ADATA.Recordset.MoveNext
  6.     Loop
code for adding under 2nd column

Expand|Select|Wrap|Line Numbers
  1. ADATA.Recordset.MoveFirst
  2.  
  3.     Do While Not ADATA.Recordset.EOF
  4.     lv.ListItems.Add 2, , ADATA.Recordset.Fields("RollNo")
  5.     ADATA.Recordset.MoveNext
  6.     Loop
This code is doing such a wierd thing add rollno and regno under a single volumn not adding into 2nd column.

Check it and plz help.

Thanx
>> ALI <<
Dec 17 '07 #1
2 973
lotus18
866 512MB
Hi all,

code for adding under 1st column

Expand|Select|Wrap|Line Numbers
  1. ADATA.Recordset.MoveFirst
  2.  
  3.     Do While Not ADATA.Recordset.EOF
  4.     lv.ListItems.Add 1, , ADATA.Recordset.Fields("RegNo")
  5.     ADATA.Recordset.MoveNext
  6.     Loop
code for adding under 2nd column

Expand|Select|Wrap|Line Numbers
  1. ADATA.Recordset.MoveFirst
  2.  
  3.     Do While Not ADATA.Recordset.EOF
  4.     lv.ListItems.Add 2, , ADATA.Recordset.Fields("RollNo")
  5.     ADATA.Recordset.MoveNext
  6.     Loop
This code is doing such a wierd thing add rollno and regno under a single volumn not adding into 2nd column.

Check it and plz help.

Thanx
>> ALI <<
Hi Ali

Try this one
Expand|Select|Wrap|Line Numbers
  1.  Do While Not ADATA.Recordset.EOF
  2.         With lv.ListItems.Add(, , ADATA.Recordset.Fields("RegNo"), 1, 1)
  3.             .SubItems(1) = ADATA.Recordset.Fields("RollNo")
  4.         End With
  5.         ADATA.Recordset.MoveNext
  6.     Loop
Note: First add 2 columns for the listview in design time or during runtime.

Rey Sean
Dec 17 '07 #2
Ali Rizwan
925 512MB
Hi Ali

Try this one
Expand|Select|Wrap|Line Numbers
  1.  Do While Not ADATA.Recordset.EOF
  2.         With lv.ListItems.Add(, , ADATA.Recordset.Fields("RegNo"), 1, 1)
  3.             .SubItems(1) = ADATA.Recordset.Fields("RollNo")
  4.         End With
  5.         ADATA.Recordset.MoveNext
  6.     Loop
Note: First add 2 columns for the listview in design time or during runtime.

Rey Sean
Thanks Rey

Thanx
I ll try and reply you.

>> ALI <<
Dec 17 '07 #3

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

Similar topics

4
by: Jeremy Ames | last post by:
I am trying to add info into a list box but I am having problems. I am trying to load the information into a tabular format within the list box, but when I try to space everything out, I get...
11
by: Brian Henry | last post by:
Well here is the problem, I have a data set with about 9,000 to 20,000 people in it in the data table "people"... I am then reading it into a list view one at a time row by row... adding each...
0
by: Brian Henry | last post by:
Here is another virtual mode example for the .NET 2.0 framework while working with the list view. Since you can not access the items collection of the list view you need to do sorting another...
3
by: Brian Henry | last post by:
So what is the easiest way to do this? I have one list view with a list of items (in detail view and with about 20 sub items) and a second list view that will take the items they drag from the...
3
by: idletask | last post by:
I have an application that has many windows. One window is used for order processing. I would like this window to display the other users who are also performing order processing (the idea is to...
5
by: zefciu | last post by:
Hi! I want to embed a function in my python application, that creates a two-dimensional array of integers and passes it as a list (preferably a list of lists, but that is not necessary, as the...
2
by: Miesha.James | last post by:
Hello, I've added a list view to a windows form and I want to add items and subitems to the list at runtime. The problem that I have is that when I try to use the list view control variable it...
4
by: JB | last post by:
I am trying to get a list of all the active computers running on my domain. I'm writing some remote management style software with WMI, which works fine when i know the computer name, but i just...
4
by: Susan Bricker | last post by:
Hi. I have an MDB that I have been working on using Access 2003. The db utilizes A2000 format. There are enough forms to require that when 'Forms' is selected from the list of Objects (in the...
3
by: =?Utf-8?B?SmFtZXMgUGFnZQ==?= | last post by:
I've a multiview with 3 views. on view 2 the user is presented with a check box list (items from database) at view 3 the user can review their selections and, either post to the database or go back...
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
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.