I have a custom editor in my XAF WinForms project (ProjectRolesEditor) which isn't quite working right.
It is designed to allow the user to easily add, edit and delete PersonProjectRole records for the currently displayed Project. These records represent the join between three tables. Persons, Projects, and ProjectRoles. They show that a person has a particular role on a project (and some other information). (This is a legacy database so doesn't use XAF's built-in join mechanism.)
The grid which shows this information has six visible columns, Person, Company, Project Role, Split Recipient, Retainer Split and Fee Split. The first two are read-only and show the person and company names. (New records are added via a Popup Control Container). The last two columns contain percentages. The Split Recipient column has a RepositoryItemImageComboBox used to let the user select "Person" or "Company" and record "P" or "C" to the database. The percentages and the ImageCombo editors all work correctly, showing existing values and allowing the user to edit them.
The Project Role column has a RepositoryItemLookupEdit as its ColumnEdit property to look up the value from the ProjectRoles collection. My problem seems to be concerned with setting up this editor. The possible values are retrieved correctly from the database by the code and the LookupEdit is bound to this data. However, depending on how I set the FieldName property of the column I can either have (1) the column read-only (dropdown button greyed out), existing data is translated but nothing in this column can be changed OR (2) I can have blanks for existing data, the dropdown active (with all the possible values shown) but any selected value gets blanked out when you leave the column.
The first behaviour happens when I set the FieldName to "ProjectRole.ProjectRoleID".
The second behaviour happens with FieldName set to "ProjectRole".
All other properties of the column and the editor remain the same.
I have probably forgotten to do something really easy but I don't know what.
I've enclosed the code for this relatively small part of the much larger project, and screenshots illustrating the two behaviours . Please have a look over it and let me know how I can alter it to make the ProjectRole column translate the existing values AND allow the user to change them.
I apologize for the delay. We need additional time to research the issue. We will keep you informed of our progress.