Listview copy?

I have a listview (with data) and want copy that..

Page 1 of 1

11 Replies - 3348 Views - Last Post: 27 May 2009 - 10:30 PM Rate Topic: -----

#1 Hellsystem  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 23-May 09

Listview copy?

Posted 24 May 2009 - 01:58 PM

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?
Is This A Good Question/Topic? 0
  • +

Replies To: Listview copy?

#2 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 8849
  • View blog
  • Posts: 33,159
  • Joined: 12-June 08

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.
Was This Post Helpful? 0
  • +
  • -

#3 June7  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 104
  • View blog
  • Posts: 904
  • Joined: 09-December 08

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

Was This Post Helpful? 0
  • +
  • -

#4 Hellsystem  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 23-May 09

Re: Listview copy?

Posted 25 May 2009 - 12:07 AM

View PostJune7, 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.
Was This Post Helpful? 0
  • +
  • -

#5 noorahmad  Icon User is offline

  • Untitled
  • member icon

Reputation: 209
  • View blog
  • Posts: 2,290
  • Joined: 12-March 09

Re: Listview copy?

Posted 25 May 2009 - 01:12 AM

:code:
Was This Post Helpful? 0
  • +
  • -

#6 June7  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 104
  • View blog
  • Posts: 904
  • Joined: 09-December 08

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
Was This Post Helpful? 0
  • +
  • -

#7 Hellsystem  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 23-May 09

Re: Listview copy?

Posted 26 May 2009 - 03:24 AM

View PostJune7, on 25 May, 2009 - 04:02 PM, said:

You want to use code to copy listview box? If not just select the listview box on form1 and copy then paste on form2


The listview on form 1 getting data form code on form 1,
I just want to get al items form listview 1, on listview 2.

Sorry for my bad english.
Was This Post Helpful? 0
  • +
  • -

#8 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 8849
  • View blog
  • Posts: 33,159
  • Joined: 12-June 08

Re: Listview copy?

Posted 26 May 2009 - 08:01 AM

View PostHellsystem, on 26 May, 2009 - 04:24 AM, said:

View PostJune7, on 25 May, 2009 - 04:02 PM, said:

You want to use code to copy listview box? If not just select the listview box on form1 and copy then paste on form2


The listview on form 1 getting data form code on form 1,
I just want to get al items form listview 1, on listview 2.

Sorry for my bad english.


So you want to copy your data from 1 to 2? Though you said otherwise.

Okay.. how much do you know about shared variables?
Was This Post Helpful? 0
  • +
  • -

#9 Hellsystem  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 23-May 09

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

/
Was This Post Helpful? 0
  • +
  • -

#10 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 8849
  • View blog
  • Posts: 33,159
  • Joined: 12-June 08

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".
Was This Post Helpful? 0
  • +
  • -

#11 Hellsystem  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 23-May 09

Re: Listview copy?

Posted 26 May 2009 - 10:48 AM

View Postmodi123_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".


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

Was This Post Helpful? 0
  • +
  • -

#12 June7  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 104
  • View blog
  • Posts: 904
  • Joined: 09-December 08

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.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1