DataGridView

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ManjuG

    #1

    DataGridView

    Hello,

    I am trying to add additional property to all the DataGridViewCel l types by
    implementing a Decorator pattern. For that I need to access protected members
    in the base class(because most of the virtual methods in the DataGridViewCel l
    are protected) through an instance of the Base class in my Decorator class
    which is also derived from Base class. What could be an alternative for this
    problem?

    Thanks for any help in advance.
  • Marc Gravell

    #2
    Re: DataGridView

    Well, rather than how you are trying to do it... what are you trying to
    accomplish?

    Marc


    Comment

    • ManjuG

      #3
      Re: DataGridView

      I want to add a new property to all the cell types without implementing in
      each cell type. For eg: I want to use the DataGridViewTex tBoxCell without
      deriving from it, but with the new property.

      Manju

      "Marc Gravell" wrote:
      Well, rather than how you are trying to do it... what are you trying to
      accomplish?
      >
      Marc
      >
      >
      >

      Comment

      • Marc Gravell

        #4
        Re: DataGridView

        That still doesn't say anything about what you are trying to achieve, which
        could influence the design... however...

        I don't think you are going to apply that to all instances very easily...

        however, a viable option might be to declare a class to hold all the extra
        data you need, and simply assign that to the Tag property. It will involve a
        cast to get from the (object) Tag to your class, but it will work. Of
        course, if you are only ever going to want to add 1 property, you could use
        the Tag directly to hold the value.

        Marc


        Comment

        Working...