DataGridView: all control properties readonly in child form.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mtembene@hotmail.com

    DataGridView: all control properties readonly in child form.

    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.
  • Marc Gravell

    #2
    Re: DataGridView: all control properties readonly in child form.

    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() {
    InitializeCompo nent();
    someGrid.Dock = Dock.Right; // etc
    someGrid.SomeEv ent += ....
    }

    Marc

    Comment

    Working...