In the following example, I have en editpage wit an PropertyEditorControl, and 3 commandbuttons for updating, Cancelling and deleting.
the code (which is basically a copy of Charles Nurse's OpenForce2007 session "Advanced Module development part2" ) works excellent up until you click the Update-Button.
The PropertyEditorControl's Datasource returns "Nothing", which again causes a problem when you want to add a new item into the database.
Oh well, Here's the Code :
Private Sub cmdUpdate_Click(ByVal sender As Object, ByVal e As Global.System.EventArgs) Handles cmdUpdate.Click
Try
If objPEC.IsValid And objPEC.IsDirty Then
Dim cont As New TPL.TPLPrcController
Dim _priceGroup As TPL.TPLPrcInfo = CType(objPEC.DataSource, TTPLPrcInfo)
If ItemId > Null.NullInteger Then
cont.UpdatePriceGroup(_priceGroup)
Else
cont.AddPriceGroup(_priceGroup)
End If
Response.Redirect(NavigateURL(), True)
End If
Catch ex As Exception
ProcessModuleLoadException(Me, ex)
End Try
End Sub
So, can anyone tell me, why this function cannot get any Datasource from the PropertyEditorControl ? Does the .ASCX-page need some kind of special Pagedirektive or...?
Im really puzzled, since everything else works just as planned.