Hide control properties

S

Steve Barnett

I've got a calendar control that extends the DataGrid View:

public class Calendar : DataGridView

This gives me all the functionality I need for my calendar without the
hassles of writing the grid capabilities from scratch. However, it also
gives the users of my control all the functionality of the DataGridView as
well and that's proving very confusing to them.

What I'd like to do is expose my properties and methods while hiding those
of the DataGridView. Is this possible?

Thanks
Steve
 
N

Nicholas Paldino [.NET/C# MVP]

Steve,

Not really, not if you extend the class. The best you could do is
create your calendar class, and hold an internal reference to the grid,
exposing the properties/methods you wish.
 
S

Steve Barnett

I was afraid of that.

Thanks
Steve


Nicholas Paldino said:
Steve,

Not really, not if you extend the class. The best you could do is
create your calendar class, and hold an internal reference to the grid,
exposing the properties/methods you wish.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Steve Barnett said:
I've got a calendar control that extends the DataGrid View:

public class Calendar : DataGridView

This gives me all the functionality I need for my calendar without the
hassles of writing the grid capabilities from scratch. However, it also
gives the users of my control all the functionality of the DataGridView
as well and that's proving very confusing to them.

What I'd like to do is expose my properties and methods while hiding
those of the DataGridView. Is this possible?

Thanks
Steve
 

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