Question

I have 2 questions concerning C#.

1) I have a dropdown menu with several items in them. They are clickable, but when I click one, the older clicked one stays selected. Click another and the 2 original ones stay selected, and so on. I don't want this. What I want is that when I click one of the dropdownitems, that one is that selected one and the others are not.

2) I have a listview items on a winform. I loaded some string elements into it from a file. Now what I want to do is to be able to edit those strings and even add strings, just by clicking on the rows in which the data goes.

I've checked google and MSDN for these problems, but nothing helps, so I turn here.

Was it helpful?

Solution

2) The ListView does not support that type of action. You can roll your own (pain in the @$$), or perhaps a DataGrid would be better suited to your purpose.

EDIT:

This link may help
This one too

OTHER TIPS

For #1 I'm a little confused. If the DropDownStyle isn't set to simple something strange is occuring. It's not much but maybe you could try recreating the control.

For #2 the easiest solution I can think of is to set a TextBox to be equal to the selected text value from your listview. After that write a little function to update the selected index of the listview with the edited text from the listview.

Please comment if you have any more information about #1.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top