954,515 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

listview row details

Hi friends,
I have a list view which contains an id and a name.... upon selecting one row i should be able to view the details of that particular row.. i.e name, age, salary etc...Im using Visual studio .net 2003 and sql server 2005..

abc_a3
Newbie Poster
2 posts since Dec 2007
Reputation Points: 10
Solved Threads: 0
 

In the selected index change or one of the click events of the list you should put.

dim strLine as strin 
strLine = List1.SelectedItem.Text


That will get you the line, from there you will need to do string splits & string manipulation on your data.

emurf
Light Poster
37 posts since Nov 2007
Reputation Points: 12
Solved Threads: 4
 

What is string split and how do we do it?

abc_a3
Newbie Poster
2 posts since Dec 2007
Reputation Points: 10
Solved Threads: 0
 

String splits allow you to easily retrieve values in a string. Lets say that the line that was read from the listview has been formated by putting a tab between the values. You would get the data like this;

'declare an array to hold the vals
dim listVals as String() = Nothing

'get the line from the list
strLine = List1.SelectedItem.Text

'get the vals from the string
listVals = strLine.Split(vbTab)


If the line wasn't formatted with tabs as it was added to the listview then you may have to use left, mid and right string functions.

Microsoft.VisualBasic.Right(string, length)
Microsoft.VisualBasic.Left(string, length)
Microsoft.VisualBasic.Mid(string, start pos, length)
emurf
Light Poster
37 posts since Nov 2007
Reputation Points: 12
Solved Threads: 4
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You