PL01

Hi,

can I visually inherit DataGridView, as described in:

http://msdn2.microsoft.com/en-us/library/aa288147(vs.71).aspx

I have a custom form with some controls (including DataGridView) which I would like to inherit other forms from.

My aim is to have the ability to change DataGridView (DGV) properties like columns, databinding, etc. on derived form.

Even when set DGV Modifiers to Protected, the Dgv is locked on derived form and I cannot change any of it's properties. It will work with other controls, with DGV will not.

Or am I missing something

Please help.




Re: Windows Forms Designer DataGridView visual inheritance

PL01

Hi,

I do not know why this answer cannot be seen in the forums, so copy-paste it from e-mail notification, because I find it helpful.

Thanks Rong-Chun Zhang !

Re: DataGridView visual inheritance
Posted by Rong-Chun Zhang - MSFT in Windows Forms Designer

HI PL01,

It is because that the derived form cannot get access to the columns which have been added to the DataGridView. The columns are still private though you have set the DataGridView's modifiers to protected. If you leave the DataGridVIew's columns blank in the parent Form or modify them to protected or public, you can edit it in derived form.

Hope this helps.

Regards






Re: Windows Forms Designer DataGridView visual inheritance

Rong-Chun Zhang - MSFT

Hi PL01,

I test it, it does not solve the problem on my machine, so I delete it. Thanks.

With regards




Re: Windows Forms Designer DataGridView visual inheritance

Rong-Chun Zhang - MSFT

Hi PL01,

This is a known issue about DataGridView. Check the following page.

https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx FeedbackID=284335&wa=wsignin1.0

Also, these is a workaround on the page, you can give it a try.

With regards.