Collection property and control owner

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • R.A.F.

    Collection property and control owner

    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
  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: Collection property and control owner

    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.


    --
    - Nicholas Paldino [.NET/C# MVP]
    - mvp@spam.guard. caspershouse.co m

    "R.A.F." <noemail@nospam .comwrote in message
    news:%23m91QiDE IHA.4544@TK2MSF TNGP06.phx.gbl. ..
    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

    Comment

    • R.A.F.

      #3
      Re: Collection property and control owner

      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

      Nicholas Paldino [.NET/C# MVP] wrote:
      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.
      >
      >

      Comment

      Working...