clebo99
asked on
Simple ListView Question - Getting Specific Column Data
Hey Everyone,
Ok, I think this is a simple question. I have a listbox that gets information from a very basic SQL query (select * from x where y = 'z', something like that). This query is going to return anywhere from 0 to probably 50 rows. What I eventually want to do is click on a specific row and bring up a new form (which I've been able to do using the ListView1_SelectedIndexCha nged) and pass data.
For now, all I want to do is have a MSGBOX come up when I click on the specific row and display information from a specific column. So, if I have a results set in a listview that looks like:
Name Date Grade
Chris 10/1/07 A
Bill 10/2/07 C
If I click on the row with "Chris", a message box comes up and just shows "A".
Make sense?
Chris, Baltimore
Ok, I think this is a simple question. I have a listbox that gets information from a very basic SQL query (select * from x where y = 'z', something like that). This query is going to return anywhere from 0 to probably 50 rows. What I eventually want to do is click on a specific row and bring up a new form (which I've been able to do using the ListView1_SelectedIndexCha
For now, all I want to do is have a MSGBOX come up when I click on the specific row and display information from a specific column. So, if I have a results set in a listview that looks like:
Name Date Grade
Chris 10/1/07 A
Bill 10/2/07 C
If I click on the row with "Chris", a message box comes up and just shows "A".
Make sense?
Chris, Baltimore
ASKER
Ok, that seemed to work........however if I go back to the same page and click on another row, I get an error stating:
InvalidArgument=Value of '0' is not valid for 'index'.
Parameter name: index
Do I need to "Reset" this somehow?
InvalidArgument=Value of '0' is not valid for 'index'.
Parameter name: index
Do I need to "Reset" this somehow?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Use the SubItems....
MsgBox(ListView1.SelectedI
Regards,
Wayne