UserControl Declarative Property with Array

A

Andrew Reeves

I have a web user control which has several properties on
it. On of these properties needs to be an array. I have
no problem with
<uc1:MyControl id="Control1"
MyProperty="xyz"></uc1:MyControl>

but how do I declare an array? I have tried the following

<uc1:MyControl id="Control1">
<MyClass MyProperty="x" />
<MyClass MyProperty="y" />
<MyClass MyProperty="z" />
</uc1:MyControl>

where MyClass is a property of type MyClassArray[] class
with a public property of MyProperty and the User Control
has the following (C#)

MyClassArray[] myClass;

public MyClassArray[] MyClass
{
set
{
myClass= value;
}
}

but it doesn't seem to work.

I notice that the DataGrid seems to do this with it's
columns.


Thanks

Andrew Reeves
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top