用户定义的类列表提供了更多属性或字段,然后定义。 [英] List of user defined class gives more properties or fields then defined.

查看:76
本文介绍了用户定义的类列表提供了更多属性或字段,然后定义。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



i宣布公开课CLS_A,其中有一个属性prp_A如下: -



Hi all,

i declared a public class "CLS_A" which has one property "prp_A" as below :-

Public Class CLS_A

Private _prp_A As Integer

Public Sub New(prp_A As Integer)
       Me._prp_A= prp_A
End Sub



i我正在创建这个用户定义类的列表,并将其作为数据源提供给数据网格。



i我在网格中再添一列_prp_ASpecified 使用布尔数据类型。



为什么这个额外的列显示了一个我怎么能删除这个。???



先谢谢。


i am creating list of this user defined class and give that to data grid as data source.

i am getting one more column in grid "_prp_ASpecified" with boolean datatype.

why this extra column is showing and how can i remove this one.???

Thanks in Advance.

推荐答案

我认为这一行



I think this line

Quote:

Me._prp_A = prp_A

Me._prp_A = prp_A





应该是





should be

引用:

Me._Age = prp_A

Me._Age = prp_A







如果是这种情况,请确保已指定 Option Explicit On 以帮助编译器帮助您解决此类问题。



根据您发布的内容,您的课程没有网格要显示的任何公共属性 - 如果要在网格中显示_prp_A,则应通过公共属性公开它。


?

If that is the case, make sure you have specified Option Explicit On to help the compiler help you with this type of issue.

Going by what you have posted, your class does not have any public properties for the grid to display at all - if you want to display _prp_A in the grid you should expose it through a public property.


hi all this this上面的问题是因为wcf服务数据成员属性。



i我在wcf服务上创建列表并从winform中消耗它。
hi all this above problem comes because of wcf service data member propertt.

i am creating list on wcf service and consume it from winform.


显然,这不是你的全班:它不会像那样编译,因为没有声明_prp_A,并且你需要在方法参数声明中有一个空格。



所以,这是你的虚假版本当你在这里发布时,或者你已经删除了太多的代码...



从VS开始:转到你加载数据网格的地方,然后查看课程键入它,然后使用VS转到定义以确保您正在查看正确的代码。

然后使用类视图窗格检查其属性和方法 - 我认为您已在此处错过的实际代码中声明了一个属性。
Clearly, that isn't your whole class: it wouldn't compile like that, as _prp_A is not declared, and you need a space in the method parameter declaration.

So, either this is a spurious version of your class, or you have cut out too much code when you posted it here...

Start in VS: go to where you load the datagrid, and check the class type it it being loaded with, then use the VS "Go to definition" to make sure you are looking at the right code.
Then use the Class View pane to examine its properties and methods - I think you have declared a property in the real code that you have missed here.


这篇关于用户定义的类列表提供了更多属性或字段,然后定义。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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