Hi,
I have created a custom Field Type in SharePoint 2010 which should serve me as a generic data picker/validator. For this purpose I have used the EntityEditorWithPicker as the base class for my control.
Also, I have added some custom properties to my Field Type which represent the configuration that the control shall use to configure the columns in the table of the PickerDialog as well as the list of fields on which I can filter. Have a look at this example:
public ExternalDBPickerDialog()
: base(new ExternalDBPickerQueryControl(), new TableResultControl(), new ExternalDBPickerEditor())
{
ArrayList columnDisplayName = ((TableResultControl)base.ResultControl).ColumnDisplayNames;
columnDisplayName.Clear();
/**
* Instead of having an hard-coded configuration of the colums
* here I would like to read this from the Field Type custom
* properties.
*/
columnDisplayName.Add("Title");
columnDisplayName.Add("ContactName");
ArrayList columnNames = ((TableResultControl)base.ResultControl).ColumnNames;
columnNames.Clear();
columnNames.Add("Title");
columnNames.Add("ContactName");
ArrayList columnWidths = ((TableResultControl)base.ResultControl).ColumnWidths;
columnWidths.Clear();
columnWidths.Add(Unit.Percentage(30).ToString());
columnWidths.Add(Unit.Percentage(30).ToString());
}
Have a look at the comment. Is there any way to read those custom properties in the PickerDialog constructor?
Thanks everybody for helping!
Vincent