Hi Alexey,
You can achieve this by creating a
ListEditor class descendant and specifying it as an Editor for the desired view.
Generally speaking, you can adjust the
necessary control at design time:
- create a new file with an empty Form
- add the necessary control onto the
form
- add an XPCollection component onto
the form and select the necessary object type in the PropertyGrid
panel
- set the control's datasource to the XPCollection
component
You can find more
details about Xpo design time in our online
documentation:
At this stage, the control should have
all the necessary information from the datasource (primarily, it is a list of
available fields), and you can use all the design time features provided by the
control.
After you have designed the control,
you can instantiate the Form and retrieve the control from it in the
CreateControlsCore method of your ListEditor descendant:
public class MyListEditor : ListEditor {
protected override object CreateControlsCore() {
Form1 form = new Form1();
MyControl myControl = form.Controls.Find("MyControl1", true)[0];
myControl.Parent = null;
return myControl;
}
}
--
Thanks, Dan
R&D,
..NET Team Developer Express Inc.