VS.Net 2005 DataGridView问题-继承形式中的锁定和不可编辑!!! [英] VS.Net 2005 DataGridView problem - locked and uneditable in the inherited forms!!!

查看:67
本文介绍了VS.Net 2005 DataGridView问题-继承形式中的锁定和不可编辑!!!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当您从包含DataGridView的窗体继承时,在可视继承方案中会发生此问题.以下是您可以自己尝试的步骤:

1.创建一个Form1
2.在工具箱中添加DataGridView
3.确保在Form1
4中将DataGridView声明为受保护的.创建一个继承自Form1的继承表单(项目->添加新项->继承表单)

问题是继承表单中的DataGridView已锁定-您不能在设计模式下移动它,也不能从属性"窗口访问它的属性-所有属性都显示为只读.

我已经在VS.Net 2005 Team Suite April和VS.Net Express Edition中尝试了这种情况,但没有成功.奇怪的是,这在旧版本的VS .Net(2月2日的团队系统测试版)中运行良好.这是一个错误还是我做错了什么?

This problem occures in visual inheritance scenarios when you inherits from a form that contains a DataGridView. Here are the steps so you can try it yourself:

1. create a Form1
2. add a DataGridView from the toolbox
3. assure that the DataGridView is declared as protected in Form1
4. create an inherited form that inherits from Form1 (Project->Add New Item->Inherited Form)

The problem is that the DataGridView in the inherited form is locked - you can't move it in design mode neither you can access it's properties from the Properties window - all the properties are displayed as readonly.

I've tried this scenario in VS.Net 2005 Team Suite April and VS.Net Express Edition and it hasn't worked. The strange thing is that this works well in older versions of VS .Net (Team System Beta 2 February). Is this a bug or am I doing something wrong? Can anyone give me a clue?

推荐答案

您可以暂时将其添加为公共对象,然后再切换回受保护的对象吗?对我来说听起来像个虫子...

乔什
Can you add it as public for now, then switch it back to protected later?  Sounds like a bug to me...

Josh


这篇关于VS.Net 2005 DataGridView问题-继承形式中的锁定和不可编辑!!!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆