ieditableobject

How do I make IEditableObject.EndEdit atomic?

If I have an Address class that implements IEditableObject, I might have EndEdit implementation like this: public void EndEdit() { // BeginEdit would have set _editInProgress and save to *Editing fields if (_editInProgress) { _line1 = _line1Editing; _line2 = _line2Editing; _city = _cityEditing; ...

How do I make IEditableObject.EndEdit atomic?

If I have an Address object which implements IEditableObject, I might have EndEdit implementation like this: public void EndEdit() { // BeginEdit would set _editInProgress and update *Editing fields; if (_editInProgress) { _line1 = _line1Editing; _line2 = _line2Editing; _city = _cityEditing; _...

Read-only DataGridView and IEditableObject

Good evening I've got a little problem with my DataGridView in a .NET Windows Forms project. The grid is read-only and bound to a sortable BindingList<T> which contains custom business objects. My business object class does implement IEditableObject. Now the BeginEdit and EndEdit methods are called all the time while navigating in the ...

Creating a generic method to cache an entity

I'm implementing the IEditableObject interface and I want to make a generic method that will know how to clone the object before BeginEdit(). I thought about reflection to iterate all public properties and copy them to a cached object. Anyone have a better idea? ...

WPF: Is it possible to call BeginEdit (IEditableObject) automatically when the binding source is updated?

I have a class that implements IEditableObject and now I'm wondering if it's possible to call BeginEdit() automatically when the source of the binding is updated? There are two possible scenarios: Object gets populated via the database. In this case, I don't want to call BeginEdit(). Object gets populated via the input fields by user....

IEditableObject state quering

Hi everybody! I was wondering if it is possible to get the "edit-state" of an entity on which has previously "applied" the BeginEdit(). For example: if i call this: ((IEditableObject)SelectedRecord).BeginEdit(); is it possible to query and get something like this: //this is pseudo code, not really existing ((IEditableObject)Select...

Change EditableObject behaviour on WPF Datagrid

I have a WPF Datagrid (.NET 4.0) with a list of viewmodel bind to ItemsSource. The viewmodel exposes the model entity that is builded from a base ancestor class that implements IEditableObject interface. Every time I edit a cell of a datagrid row the beginedit method of entity is called; I would a different behaviour: call the BeginEdi...

WPF: What could cause a DataGrid to call IEditableObject.BeginEdit/EndEdit but never IEditableObject.CancelEdit

When I start editing my grid IEditableObject.BeginEdit. And if I leave then IEditableObject.EndEdit is called. However, if I press Escape then IEditableObject.CancelEdit doesn't get called. This was working before, so I'm not sure what I did to break it. Or even what can break it. ...

LINQ entities used in models. Can I use OnPropertyChanged, and IEditableObject?

Let's say I have an app and a web site using the same database. I wan't to create a Data layer and some model objects. In many cases the model objects uses alot of info from some of the database tables. My idea was to wrap the LINQ to SQL entity class for the table inside the view so I won't have treate the properties again. I was wonde...

How do I use DataGrid built-in commands to Add, Remove and Edit Strongly Typed DataRows?

Before I actually ask the question, I need to explain my current situation. I have a strongly typed (generated with VS2010) DataSet. Along with that, I have the corresponding typed DataTable and DataRow. My problem happens when I commit a row using the DataGrid's built-in commands. It calls the BeginEdit(), CancelEdit() (only when I c...

What is the type of object added by IEditableCollectionView?

Adding objects with the IEditableCollectionView addNew() method is pretty decent. However I'm not sure how well it works with my generic code I have. I have a ObservableCollection of my base class. Depending on what the user wants to see it can be filled with DerivedA or DerivedB ( or mutliple other derived type classes ). It never has ...