Questions tagged [ieditableobject]

IEditableObject is an interface in the .NET framework to allow objects to be edited by a user.

IEditableObject is an interface in the .NET framework to allow objects to be edited by a user of your program. When the user is finished with its edits, he can confirm the changes to the object or abort. On abort a backup is restored so the original data gets restored.

17 questions
18
votes
4 answers

WPF DataGrid calls BeginEdit on an IEditableObject two times?

I've got a DataGrid bound to a collection of IEditableObject's. Now when I click two times in a cell, it will be opened for editing. Funny thing is: BeginEdit will be called two times. Sometimes for the same EditableObject, but sometimes for two…
Sam
  • 28,421
  • 49
  • 167
  • 247
8
votes
3 answers

IEditableObject in MVVM

Can you think of a scenario where IEditableObject would be still usefull in an MVVM-based WPF application? If so, do you have an example that demonstrates this.
bitbonk
  • 48,890
  • 37
  • 186
  • 278
3
votes
2 answers

How to prevent CurrencyManager from calling BeginEdit()/EndEdit() methods for bound objects

I've got a form with several textboxes and one datagrid. One business entity can be bound to this form. For example, BO looks like this: class BO : IEditableObject, INotifyPropertyChanged { public string FirstName {get; set;} public string…
Dmitry
  • 1,220
  • 2
  • 11
  • 18
3
votes
1 answer

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…
3
votes
1 answer

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 which contains custom business objects. My business object class does implement…
Matthias Meid
  • 12,455
  • 7
  • 45
  • 79
2
votes
0 answers

WPF Datagrid: how avoid IEditableObject behavior?

I've a Wpf Datagrid with a collection of entity as ItemsSource; entity type implements IEditableObject interface (BeginEdit, CancelEdit, EndEdit). I want to prevent the datagrid automatically call methods of IEditableObject interface, because I…
Luca Petrini
  • 1,695
  • 2
  • 28
  • 53
2
votes
1 answer

What is the usage of IEditableObject with DataGrid?

Here's the excerpt from https://learn.microsoft.com/en-us/archive/blogs/vinsibal/5-random-gotchas-with-the-wpf-datagrid: 5.Data source items should implement IEditableObject to get transactional editing functionality. If you are not familiar with…
alice
  • 2,547
  • 4
  • 24
  • 30
1
vote
1 answer

Silverlight MVVM IEditableObject Dialog

I am playing around with the BookShelf demo application by John Papa. And would like to make some adjustments in how a book item is edited. In that application both the BookView and the EditBookWindow is bound to the same ViewModel BookViewModel…
Kman
  • 4,809
  • 7
  • 38
  • 62
1
vote
1 answer

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…
Chen Kinnrot
  • 20,609
  • 17
  • 79
  • 141
0
votes
1 answer

Silverlight DataForm, MVVM, IEditable object and custom EditTemplate. How to go about custom dirty state checking

I have an interesting problem with the Silverlight DataForm and child collections. I've also got a solution that works but it feels like a hack (it is a hack) and I was wondering if anyone had a more elegant solution. I've got a DataForm bound to a…
EightyOne Unite
  • 11,665
  • 14
  • 79
  • 105
0
votes
0 answers

DataGrid, MVVM and IEditableObject

I have created a DataGrid. Now I want to save the cells that I have edited in a database using RestSharp. I read that it works with IEditableObject. I tried to insert it. Here is the start of my ViewModel: class LDViewModel : NotifyPropertyBase,…
Sascha
  • 37
  • 6
0
votes
2 answers

Prevent IEditableObject.BeginEdit() is called multiple times

I have an entity, e.g. customer inherited from IEditableObject, like described here: public class Customer : IEditableObject { ... private Boolean backupAvailable = false; private ThisObject backupData; public void BeginEdit() …
Beetee
  • 475
  • 1
  • 7
  • 18
0
votes
1 answer

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…
Jonathan Allen
  • 68,373
  • 70
  • 259
  • 447
0
votes
1 answer

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…
aks
  • 292
  • 1
  • 5
  • 12
0
votes
2 answers

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…
Jiho Han
  • 1,610
  • 1
  • 19
  • 41
1
2