Matt said:
Hello Frankk,
Let me restate your question to make sure I understand:
You want to expose a collection property from one of your custom
controls. You would like the user to be able to click the ellipsis and
have a collection editor come up.
When the user makes selections to this collection editor, those
selections should be persisted to code (probably in the
InitializeComponent section).
Am I understanding your situation correctly, and if so, where are you
currently stuck?
--
Matt Berther
http://www.mattberther.com
Matt,
controls
-----------------------------------------------------------------------
There is no "custom controls" and no "run time", just a non-visual
component at design time. In the component, I have ->
public string prop1 {get {return rip;} set {rip = value;}}
public string prop2 {get {return rport;} set {rport = value;}}
when I compile the component and then load that onto a test Winform, I
see 2 properties at desing time (prop1 and prop2).
How can I setup a prop3 get/set as a collection property just like the
TablStyle property (Collection ...) so at design time, user can "Add" to
the collection and fill in the properties (right pane).
At run time, user can then retrieve the "items" entered at design time
and then use the data for the application. When user save the file, all
the data entered in "prop3" will be retained. I thoguht this would be a
great and flexible way for user to enter a collection of data in the
component. In my case, it would be the actual Ethernet devices that the
applciation is controlling.
Using the "popular" user control (run time) approach, all data entered
in run time has to be saved and then reloaded at the next run. I noticed
that in the TableStyle collection property of the dataGrid, once you
defined the TableStyle at Design time, the dataGrid will be displayed at
run time accordingly and you do not have to do any coding at all. I am
trying to use this idea excepted that I want to do it in the non-visual
component instead of a user control (visual).
Is this possible?
Thanks,
Frankk