What I'm trying to do is to Add the information of Two Tables into a single
ListView. The ListView has 10 columns.

The following Code populates the LV columns 1 to 5 (or rather 0 to 4) from a
DataSet...

Private Sub MstrEmPay()

Dim dtDataTbl As DataTable = DsMstrEmPay.MASTER_PRM_EMPLOYEE_PAY

' Get Info from Data Base
For cntr = 0 To DsMstrEmPay.MASTER_PRM_EMPLOYEE_PAY.Rows.Count - 1
Dim dr As DataRow = dtDataTbl.Rows(cntr)

Dim LItem As New ListViewItem
Dim rowTtl As Double = 0
LItem = New ListViewItem
LItem.Text = dr("amount")
LItem.SubItems.Add(dr("employee"))
LItem.SubItems.Add(dr("pay_id"))
LItem.SubItems.Add(dr("pay_type"))
lvProjDisplay.Items.Add(LItem)
Next ' cntr

End Sub


What I want to do is to get the info of another DataSet and dump it's info
into the next 5 remaining Columns (starting at the first row of the
ListView).

I've done some reading and I 'think' I need something like:

LItem.SubItems.Insert(5, myTextHere)... but haven't found how to make this
work.

Anyone can help?

Regards,

Bruce

Re: Adding Column Info to ListView by Björn

Björn
Thu Jun 17 04:37:30 CDT 2004

"Mr. B" <User@NoWhere.com> wrote in message
news:kt92d0teabk6o04irub6no6j3rav6vd7kj@4ax.com...
> What I'm trying to do is to Add the information of Two Tables into a
single
> ListView. The ListView has 10 columns.
>
> The following Code populates the LV columns 1 to 5 (or rather 0 to 4) from
a
> DataSet...
>
> Private Sub MstrEmPay()
>
> Dim dtDataTbl As DataTable = DsMstrEmPay.MASTER_PRM_EMPLOYEE_PAY
>
> ' Get Info from Data Base
> For cntr = 0 To DsMstrEmPay.MASTER_PRM_EMPLOYEE_PAY.Rows.Count - 1
> Dim dr As DataRow = dtDataTbl.Rows(cntr)
>
> Dim LItem As New ListViewItem
> Dim rowTtl As Double = 0
> LItem = New ListViewItem
> LItem.Text = dr("amount")
> LItem.SubItems.Add(dr("employee"))
> LItem.SubItems.Add(dr("pay_id"))
> LItem.SubItems.Add(dr("pay_type"))
> lvProjDisplay.Items.Add(LItem)
> Next ' cntr
>
> End Sub
>
>
> What I want to do is to get the info of another DataSet and dump it's info
> into the next 5 remaining Columns (starting at the first row of the
> ListView).
>
> I've done some reading and I 'think' I need something like:
>
> LItem.SubItems.Insert(5, myTextHere)... but haven't found how to make this
> work.
>
> Anyone can help?


What kind of listview is that? The ListView from "Microsoft Windows Common
Controls" version 5 and 6 doesn't have an Items collection (it's called
ListItems).

--
Björn Holmgren
Guide Konsult AB



Re: Adding Column Info to ListView by Björn

Björn
Thu Jun 17 04:38:57 CDT 2004

"Björn Holmgren" <bjohol@hotmail.com> wrote in message
news:wDdAc.52420$zm5.27019@nntpserver.swip.net...
>
> What kind of listview is that? The ListView from "Microsoft Windows Common
> Controls" version 5 and 6 doesn't have an Items collection (it's called
> ListItems).


Wait a minute! Is that VB.NET? (I'm reading this from vb.database.ado)

--
Björn Holmgren
Guide Konsult AB



Re: Adding Column Info to ListView by Mr

Mr
Thu Jun 17 21:21:08 CDT 2004

With Deft Fingers, "Björn Holmgren" <bjohol@hotmail.com> wrote:


>> What I want to do is to get the info of another DataSet and dump it's info
>> into the next 5 remaining Columns (starting at the first row of the
>> ListView).
>
>What kind of listview is that? The ListView from "Microsoft Windows Common
>Controls" version 5 and 6 doesn't have an Items collection (it's called
>ListItems).

Sorry... VB.net!

Bruce

Re: Adding Column Info to ListView by Mr

Mr
Thu Jun 17 21:21:29 CDT 2004

With Deft Fingers, "Björn Holmgren" <bjohol@hotmail.com> wrote:

>"Björn Holmgren" <bjohol@hotmail.com> wrote in message
>news:wDdAc.52420$zm5.27019@nntpserver.swip.net...
>>
>> What kind of listview is that? The ListView from "Microsoft Windows Common
>> Controls" version 5 and 6 doesn't have an Items collection (it's called
>> ListItems).
>
>
>Wait a minute! Is that VB.NET? (I'm reading this from vb.database.ado)

Yes.... sorry (I keep forgetting).... VB.net!

Bruce