|
-
Sep 18th, 2003, 05:57 AM
#1
Thread Starter
Lively Member
Listview Items
Can anyone help me i am new to .Net and i can't get this working?
i have a listview which has been populated from a dataset and i want to load the data into text boxes i can get row 0 to load but i want to have it so if i click on row 3 for example it puts row 3's data in to the text boxes.
Please tell me if i'm going wrong or if i'm just stupid!!
if i change the Rows(0) bit the different rows that works but i want it to change when i select the row.
Here is my code
txtUsername.Text = dsUser.Tables("User").Rows(0). Item("Username")
txtUsername.Enabled = False
txtFirstName.Text = dsUser.Tables("User").Rows(0). Item("FirstName")
txtUserInitial.Text = dsUser.Tables("User").Rows(0). Item("MiddleInitial")
txtSurname.Text = dsUser.Tables("User").").Rows(0).Item("Surname")
txtAssetNo.Text = dsUser.Tables("User").").Rows(0).Item("AssetNumber")
txtEmail.Text = dsUser.Tables("User").").Rows(0).Item("EmailAddress")
cboUserLocation.Text = dsUser.Tables("User").").Rows(0).Item("Branch")
cboUserFloor.Text = dsUser.Tables("User").").Rows(0).Item("Floor")
Last edited by nokia8210; Sep 18th, 2003 at 09:35 AM.
-
Sep 18th, 2003, 09:11 AM
#2
Thread Starter
Lively Member
-
Sep 18th, 2003, 09:27 AM
#3
Addicted Member
put this in the click or selectedindexchange event of the listview
Your text box.text = listview.selecteditem(0).subitems(which ever colum).text
Bit confused by your code?? Looks like you are loading from a dataset?
Wind and waves resolves all problems.
-
Sep 18th, 2003, 09:28 AM
#4
Thread Starter
Lively Member
sorry yes i am thanks will try
-
Sep 18th, 2003, 09:41 AM
#5
Thread Starter
Lively Member
sorry it doesn't work say's " 'SelectedItem' is not a member of 'system.windows.forms.listview' "
any other idea's??
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|