By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,594 Members | 2,059 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,594 IT Pros & Developers. It's quick & easy.

List View Problem

Ali Rizwan
100+
P: 927
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
Share this Question
Share on Google+
2 Replies


lotus18
100+
P: 866
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
100+
P: 927
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

Post your reply

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