Hi, i have a BindingList as a datasource and a grid control, if the user deletes a row in the grid, i want him to get a confirmation (a messagebox for example),
the grid control i'm using (and i guess most of them), call the RemoveAt(int index), method of Collection which has a void return value, even if i'll inherit from bindingList, override the method or provide a new implemtation for it (and other), it won't help because the grid has no way to know that the user chose to cancel the operation...
is there a way around the problem using only databinding and the stock bindinglist, grid control?
the workaround i did is : a. inherit form BindingList, implement ICancellableRemoving (which contains a single "bool RemoveItem(object item)". b. inherit from the grid,override it's remove method (or similar), check if the datasource implements ICancellableRemoving, if it does, call the method, examine the result and cancel/proceed with the operation accordingly.
P.S I implemented an interface because the only "Remove*", method in BindingList, which has a bool return value is Remove(T Item) of Collection, and it's generic... the grid isn't ;)
Thanks in advance, Erik.