Collection property and control owner

R

R.A.F.

Hi,

I have a custom control in which i have a property called
"RowsCollection". This property is a CollectionBase class.
this class allows user to add new rows to the property.

I defined in my RowsCollection a private variable member which holds the
basic height of each row to 20;

when i create a row thanks the RowsCollection property, each row have a
property Height, but it is setup to 0.

How can i do to pass such default value (20) to each row, only during
row creation ?

thanks a lot,

RAF
 
N

Nicholas Paldino [.NET/C# MVP]

RAF,

You would have to declare a constructor that takes the height, and then
pass the value to the constructor when the instance is created.
 
R

R.A.F.

Hi Nicholas,

this i know, but how to do from a property which is in fact a collection ?

how the Add function from collectionBase can pass such information ?
or should it be done thanks my custom collection property editor ?
if yes, where and how ?

this i've never done before.

thanks a lot,

RAF
 

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

Top