Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1130
InitializeRecord problem
posted

I have the following code handling the InitRecord event from a xamDataGrid.  The problem is that when the event is raised on a new object, the DataItem is returning null, even though the new object was successfully added to the collection in memory.  Any ideas?

private void LocationsGrid_InitializeRecord(

object sender,

InitializeRecordEventArgs e

) {

DataRecord record;

record = (DataRecord)e.Record;

if ( record.DataItem != null ) {

record.FieldLayout.Fields[ "Location" ].Settings.AllowEdit =

( (IEditableBusinessObject)record.DataItem ).IsNew;

}

}