I have a simple form with list as a data source, a binding source bound to the list, and a combo box bound to the binding source with some fields editing whatever the bindingSource.Current
is. What I would like to do is if a bool is set pop up a dialog asking if they want to save changes before they change items. If they say no I want to call CancelEdit()
if yes I want to keep them on the current item so they can click the save button. How do I do this?
The second part of my question is because my underlining data source is a List<View>
will CancelEdit()
even do anything? (View is just a class with string Name
and a List<CustomColumn>
Edit:
Let me elaborate on what I am doing to maybe help explain what I am doing.
I have a list of View, these elsewhere in the program will be enumerated to generate a DataGridView
. What this menu is for is adding new "Views" and changing the order of the columns in the view (it never actually edits the the CustomColumn
just adding items and changing the order of the list<CustomColumn>
). What I want to happen is if someone presses cancel or changes to a new view by using the combo box without saving it will undo any changes they made to the List<CustomColumn>