DataGridView的锁定在一个继承用户控件控件、用户、DataGridView

2023-09-02 01:50:40 作者:穻宙帥仼孒

我有一些就可以了predefined控制(组框,按钮,datagridview的)一个用户控件,这些控件被标记为保护和组件变量也标记为受保护。

I have a UserControl with some predefined controls (groupbox,button,datagridview) on it, these controls are marked as protected and the components variable is also marked as protected.

然后,我想从这个基础用户控件到另一个用户控件继承,但是在DataGridView始终锁定在设计师。

I then want to inherit from this base UserControl to another UserControl, however the DataGridView is always locked in the designer.

我怀疑它可能有一些做的的DataGridView实施ISupportInitilize。

I suspect it may have something to do with the DataGridView implementing ISupportInitilize.

public class BaseGridDetail : UserControl

有一个DataGridView控件(等)定义的。

Has a DataGridView control (et al) defined.

public class InheritedDetail : BaseGridDetail

DataGridView控件被锁定

The DataGridView control is locked

没有人有任何想法如何使设计人员可用此控制inheritenace后?

Does anyone have any ideas how to make this control available in the designer after inheritenace?

推荐答案

通过它的外观,DataListView(以及一些其他控件)不支持可视化继承。有一个连接问题登录这里看起来并不乐观。

By the looks of it, DataListView (and some other controls) do not support visual inheritance. There's a connect issue logged here which doesn't look hopeful.

目前已记录与其他形式的控制,如类似问题flowlayoutpanel.

There have been similar issues logged with other form controls, e.g. flowlayoutpanel.

我无法找到一个方法来迫使可视化继承。

I'm unable to find a way to force visual inheritance.

下面是关于connect: 对于这个特殊的版本,在DataGridView不设计在视觉intheritance使用。我们将保持您的建议记住,当我们计划我们的未来版本 这就是26/05/2006

Here's the official answer on connect: "For this particular release, the DataGridView was not designed to be used in visual intheritance. We will keep your suggestion in mind when we plan our future release" That is of 26/05/2006.

更新:发现这个博客帖子可能有答案

编辑:我无法核实博客帖子的说法。 看起来像可能在这个问题上的最新

I was unable to verify the blog post's claims. Looks like might be the latest on this issue

看起来你仍然可以操纵DataListView在运行,因此你也许可以设置可视属性(和其他设置)。这不是一个很大的让步。

It looks like you can still manipulate the DataListView at runtime though, so you might be able to set visual properties (and other settings). It's not a great compromise.

 
精彩推荐
图片推荐