1
Good morning. I have a listview with a list view. I wanted you to save the selected value when clicking on a certain line. How can I do?
1
Good morning. I have a listview with a list view. I wanted you to save the selected value when clicking on a certain line. How can I do?
3
If at any time you need to take the selected value from listview use the following code:
listView.SelectedItems[0].ToString();
If you need every time the selected item changes the value to be updated somewhere use the event Selectedindexchanged and it can use the same top code to pick up the value.
Remember
listview has multi-selection property (choose multiple items at the same time), make sure that this is what you want.
she’s using a third-party component, Infragistics, but it’s certainly something like =]
while typing I went to make sure in the code and did not see this comment, I will edit
I got it. It worked anyway ! :)
@Rovannlinhalis if you look at the editing history you’ll notice that I edited the question, but AP managed to do it the first way so I reversed the editing
I just made an observation, because I don’t know the control she’s using, and it could be different. =]
Yes, and thank you for informing me =P
I have this, as I do in this part, to select the item ? : if(listview.Items[j].)
2
Using Infragistics, it may be possible to select the item on listvew as follows:
string text = listView.SelectedItems[0].Text.ToString();
Browser other questions tagged c#
You are not signed in. Login or sign up in order to post.
What did you try?
– Leo Longhi
listview.SelectedItems.Tostring();
– Ana Carvalho
Various events such as the click ...
– Ana Carvalho
My problem is that I’m using a listview from Infragistics
– Ana Carvalho
she has the Selectedindexchanged event ?
– Rovann Linhalis
No. You have Itemactivated; Itemselectionchanged;
– Ana Carvalho
uses the Itemselectionchanged
– Rovann Linhalis