Hello,
On form 1 i have a LISTVIEWbox with 4 colums, the data loading form a sql-ce database..
How i can copy this listview? and show it on form 2?
Listview copy?I have a listview (with data) and want copy that..
Page 1 of 1
11 Replies - 2684 Views - Last Post: 27 May 2009 - 10:30 PM
Replies To: Listview copy?
#2
Re: Listview copy?
Posted 24 May 2009 - 06:24 PM
Is this list view tied to a dataset? If not it should be. Then it's a matter of copying one dataset to another.
#3
Re: Listview copy?
Posted 24 May 2009 - 06:31 PM
You have a listview box on form2 and you want to populate it with the items from listview box on form1? You don't want to use the same RowSource expression because would have to read from the SQL DB second time? If form2 opens after form1 and form1 remains open, code in form2 onload event could refer to the listvewbox1 and read/copy each item in a loop.
This post has been edited by June7: 24 May 2009 - 06:32 PM
#4
Re: Listview copy?
Posted 25 May 2009 - 12:07 AM
June7, on 24 May, 2009 - 05:31 PM, said:
You have a listview box on form2 and you want to populate it with the items from listview box on form1? You don't want to use the same RowSource expression because would have to read from the SQL DB second time? If form2 opens after form1 and form1 remains open, code in form2 onload event could refer to the listvewbox1 and read/copy each item in a loop.
The data comes form SQL-CE!, and i don't want to read form the SQL-DB.
I just want copy the listbox and show this on form 2.
(Note: I don't want to copy my data!)
Form2 is is open after i click on a button on form 1.
#6
Re: Listview copy?
Posted 25 May 2009 - 05:02 PM
You want to use code to copy listview box? If not just select the listview box on form1 and copy then paste on form2
#7
Re: Listview copy?
Posted 26 May 2009 - 03:24 AM
#8
#9
Re: Listview copy?
Posted 26 May 2009 - 09:46 AM
Shared Variables?
i think you don't understand me..
I just van get al the items form listview1(On form 1) to listview 1 (On form 2), al the data in the listview is writed by code.
The database is loading form code, not with the data wizard
sorry for my english
/
i think you don't understand me..
I just van get al the items form listview1(On form 1) to listview 1 (On form 2), al the data in the listview is writed by code.
The database is loading form code, not with the data wizard
sorry for my english
/
#10
Re: Listview copy?
Posted 26 May 2009 - 10:41 AM
So wait - you fill your list view from hard coded values *not* the database?
that's what this line says "al the data in the listview is writed by code. "
I don't know how to react to that when I then read "The database is loading form code".
that's what this line says "al the data in the listview is writed by code. "
I don't know how to react to that when I then read "The database is loading form code".
#11
Re: Listview copy?
Posted 26 May 2009 - 10:48 AM
modi123_1, on 26 May, 2009 - 09:41 AM, said:
So wait - you fill your list view from hard coded values *not* the database?
that's what this line says "al the data in the listview is writed by code. "
I don't know how to react to that when I then read "The database is loading form code".
that's what this line says "al the data in the listview is writed by code. "
I don't know how to react to that when I then read "The database is loading form code".
I mean, that my database is 100% in my code, i use the SQL-CE-Desktop database.. (.SDF File) i don't use a wizard..
The code below i use to add value's to a listview
Dim i As Integer
Dim String1 As String
Dim String2 As String
Dim String3 As String
Dim string4 As String
Dim string5 As String
Dim string6 As String
For i = 0 To MaxRows - 1
String1 = ""
String1 = DataSet.Tables("filmdb").Rows(i).Item("FilmNaam")
String2 = ""
String2 = DataSet.Tables("filmdb").Rows(i).Item("FilmJaar")
String3 = ""
String3 = DataSet.Tables("filmdb").Rows(i).Item("FilmID")
string4 = ""
string4 = DataSet.Tables("filmdb").Rows(i).Item("Speelduur")
string5 = ""
string5 = DataSet.Tables("filmdb").Rows(i).Item("Drager")
string6 = ""
string6 = DataSet.Tables("filmdb").Rows(i).Item("Gezien")
Dim Input1 As New ListViewItem
With Input1
.Text = String3
.SubItems.AddRange(New String() {String1, String2, string4, string6})
End With
listview1.Add(Input1)
Next
This post has been edited by Hellsystem: 26 May 2009 - 11:05 AM
#12
Re: Listview copy?
Posted 27 May 2009 - 10:30 PM
Is there a language barrier here? You want the same items that are in listbox1 on form1 to also be in listbox1 on form2? Just repeat the code that loaded the first listbox. Or build one subprocedure that can be called by each form.
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote








|