Good morning. I have a listView with a list view. I wanted you to click on a certain line and save the selected value. How can I do it?
Good morning. I have a listView with a list view. I wanted you to click on a certain line and save the selected value. How can I do it?
If at some point you need to get the value selected in 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 SelectedIndexChanged event and you can use the same code from above to get the value.
Remember
The listView has the multi-select property (choose multiple items at the same time), make sure this is what you want.
Using Infragistics, you may be able to select the item in listvew as follows:
string text = listView.SelectedItems[0].Text.ToString();