NewMom2Brandon
asked on
URGENT Need help with ListView Tag item
I have a tag assigned to each item added into a listview.
It looks like this
item.Tag = sCat + ", " + sDog + ", " + sBreed + ", " + sPetName + ", " + sPetAge;
What I need to pull the first item from the listview and populate 5 text boxes with the information in the tag. For example Cat would go in 1 box, dog in another and so on.
Then if the listview selected item changes...I would need to update the fields with the new tag information.
The reason I used Tags was becasue I couldn't think of another way to have the information hidden from the main screen. So I just used the tag for each line.
Does anyone have any code examples on how I could do this. Or a better way of doing this.
It looks like this
item.Tag = sCat + ", " + sDog + ", " + sBreed + ", " + sPetName + ", " + sPetAge;
What I need to pull the first item from the listview and populate 5 text boxes with the information in the tag. For example Cat would go in 1 box, dog in another and so on.
Then if the listview selected item changes...I would need to update the fields with the new tag information.
The reason I used Tags was becasue I couldn't think of another way to have the information hidden from the main screen. So I just used the tag for each line.
Does anyone have any code examples on how I could do this. Or a better way of doing this.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
plz inform me about ur opion
thanks for grade A
thanks for grade A
ASKER
I think it is a very professional solution. Concidering I need to access these values in mulitiple places making it public is a better than using the same function in mulitple places.
This was the way I would have gone if several other factors had not needed to change in my project. Instead I went the direction of creating a hashtable and using that to filter out the view instead of using the tags.
This was the way I would have gone if several other factors had not needed to change in my project. Instead I went the direction of creating a hashtable and using that to filter out the view instead of using the tags.
item.Tag = sCat + "," + sDog + "," + sBreed + "," + sPetName + "," + sPetAge;
String[] values = item.Tag.ToString().Split(
for (int i = 0; i <= values.GetUpperBound(0); i++)
{
Debug.WriteLine(values[i])
}