By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,213 Members | 1,092 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,213 IT Pros & Developers. It's quick & easy.

DataGridView: all control properties readonly in child form.

P: n/a
I have a windows form "BaseForm" that contains a DataGridView that is
not bound to any datasources and a button. Both of these controls
have a modifier of "Protected Internal" and none of the controls are
locked on this form.

I have another windows form call "ChildForm" that inherits
"BaseForm". When I open"BaseForm: in VS2005 I can see both the
DataGridView and the button and I can view all of the properties of
these controls. However I can not change any of the properties of the
DataGridView. So I can not add an event listener to the datagridview
in "ChildForm". I can however change any of the properties in the
Button that was inheritied from "BaseForm".

Can anyone tell me if this behavior is expected or is it just odd?

I really want to be able to change the properties of the DataGridView
in "ChildForm" and would appreciate any pointers as to how this might
be done.

Thanks

M.
Jul 28 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Well, it wouldn't hugely surprise me if the IDE didn't like editing
these on the sub-form, but if the grid is protected (rather than
private) you should be able to do it programatically - for example in
the constructor:

public Form2() {
InitializeComponent();
someGrid.Dock = Dock.Right; // etc
someGrid.SomeEvent += ....
}

Marc
Jul 29 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.