When I set up the property of a user component, I use ->
public ArrayList Source {
get {return rsource;} set {rsource = value;}
}
But the source has two properties - Name and ID. How can I set this up such that the Source property Object Collection Editor conatins the Name and ID Properties in the right pane when I add a new source.
Thanks,
Frank

How to setup ArrayList properties
Mark Marsh
public class SourceClass
{
public string ID;
public string Name;
}
But I need to delare that in the property as an ArrayList so different set of values can be entered in the property Listbox.
ArrayList rsource;
public ArrayList Source
{
get {return rsource;}
set {rsource = value;}
}
Is this possible
Frank
Hi Its Me
Paul Nolan
YourObject.Source.ID = 223;
YourObject.Source.Name = "KraGiE";
Divyachandra
I am not that far yet. I am still trying to define the property of "Source" so that when the component is compiled and then used by the test windows program, the property window of the component shows the members (name and ID) of "Source" on the right pane when added. Can you be kind enough to show a few more lins of code
Thanks,
Frank
jgrant
Thanks,
Frank
thePrisoner06
Anyways, with the ArrayList, it's a little tricky because it contains objects. Therefore, you're going to have to cast the object into the type you need it to become.
for example..
Source tempSource = (Source) YourObject.Source[0];
Once you've done that, you can return the correct values from the properties in the actual object you are storing in the ArrayList. You have to keep in mindn that ArrayList is a collection object. That's why it rests in System.Collections namespace.
I'm not sure if you understand or not, but you have to iterate through the ArrayList to get the object you wish to display values from.
Ney André de Mello Zunino
Look at the TableStyles property of the dataGrid. When you add a Style, there is a corresponding set of properties. How is the Get/Set properties done for this "TableStyles" property done. This is exactly what I am looking for.
Frank