Visual Basic .NET Forums  
Click here to advertise with us

Go Back   Visual Basic .NET Forums > Components & Controls > Listviews / Treeviews

Listviews / Treeviews Anything related to listview and treeview components

VB.NET Forums Newsletter Signup:
Email address:


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-04-2009, 11:35 AM
VB.NET Forum Newbie
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Apr 2009
Posts: 8
Reputation: 0
Roofuss is on a distinguished programming path ahead
Default getting data from a listView

Hi i currently have a listview on my form that is set to "details" view and is popoulated by a table in my sql database.

what i want to be able to do is when i double click on a selected row i want all the details in that row to appear in another form so that i can edit them.

how do i populate the edit form with the data from the selected row i am double clicking on?

can anyone help me?

Thanks Roofuss
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 10-02-2009, 1:24 PM
VB.NET Forum Newbie
.NET Framework: .NET 2.0 (VS 2005)
 
Join Date: Oct 2009
Posts: 2
Reputation: 0
beisikas is on a distinguished programming path ahead
Default getting data from a listView

I'd suggest: on the second form You may place some textbox controls (with "ReadOnly" property set to false"), their count corresponds to number of colums of Your Listview. Let's say the name of those controls are Text1, Text2 an so on.
Then, to the first form, witch contains Listview control, You must add a sub that handles the double_click event of listview:

Private Sub ListView1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListView1.DoubleClick

'Inside this sub you put the code for reading the selected item's text and item's subitems texts, smth like this:
Form2.Text1.Text=Me.ListView1.SelectedItems(0).Tex t
Form2.Text2.Text=Me.ListView1.SelectedItems(0).Sub Items(0).Text
'an so on.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Tags
listview, sql


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





All times are GMT -4. The time now is 5:57 AM.

Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2


For advertising opportunities click here.