Does anyone have a quick example of using an EditableRootList with an updatable grid in asp.net code.
I can't quite work out the code for the CSLADatSource_SelectObject, UpdateObject, InsertObject and DeleteObject.
Thanks,
Bill
Hmm, it isn't really designed for the web - I created it to support a scenario for Windows Forms (and now WPF).
However, it should work in the web as long as you keep it in session.
The SelectObject would be like any other collection - no difference there.
But the Update/Insert/Delete handlers would be different. You need to
Rocky, thanks for the reply.
I have just tried a simple test using Delete and the DataSource_Delete handler is not firing when I delete from the grid.
I have debugged this and the CanDelete Property in CslaDataSourceView is returning False:
Public Overrides ReadOnly Property CanDelete() As Boolean
Get
If GetType(Csla.Core.IUndoableObject).IsAssignableFrom( _
CslaDataSource.GetType(mTypeAssemblyName, mTypeName)) Then
Return True
Else
Return False
End If
End Get
End Property
The code is the same for the CanInsert and CanUpdate.
Do you have any idea of how I could work around this.
Thanks,
Bill
Hmm, that’s an interesting issue that I hadn’t
thought about…
Obviously ERLB isn’t undoable itself. I wonder, however,
if the check shouldn’t be a little broader. I should be able to see if
IBindingList is implemented, and if so I can get the true/false answer from
that interface.
Something to add to the to-do list.
Rocky
From: Blarm
[mailto:cslanet@lhotka.net]
Sent: Thursday, June 07, 2007 12:09 PM
To: rocky@lhotka.net
Subject: Re: [CSLA .NET] EditableRootList in asp.net
Rocky, thanks for the reply.
I have just tried a simple test using Delete and the DataSource_Delete
handler is not firing when I delete from the grid.
I have debugged this and the CanDelete Property in CslaDataSourceView is
returning False:
Public Overrides ReadOnly Property CanDelete() As Boolean
Get
If
GetType(Csla.Core.IUndoableObject).IsAssignableFrom( _
CslaDataSource.GetType(mTypeAssemblyName, mTypeName)) Then
Return True
Else
Return False
End If
End Get
End Property
The code is the same for the CanInsert and CanUpdate.
Do you have any idea of how I could work around this.
Thanks,
Bill
Copyright (c) Marimer LLC