Click here to Skip to main content
15,896,376 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi all,

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

VB
Public Class CLS_A

Private _prp_A As Integer

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

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.
Posted
Updated 6-Apr-14 22:18pm
v3

I think this line

Quote:
Me._prp_A = prp_A


should be

Quote:
Me._Age = 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.
 
Share this answer
 
v2
Comments
jayeshkumar.rathod 7-Apr-14 4:17am    
hi,
Thanks for replied but actually there was some typo mistake can you see again the same?. i just updated the question.
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.
 
Share this answer
 
v3
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.
 
Share this answer
 
Comments
jayeshkumar.rathod 7-Apr-14 4:20am    
hi OrigianalGriff ,
i believe you are right.
and one more thing can u see the same again please?
OriginalGriff 7-Apr-14 4:30am    
What does the class view pane show?
jayeshkumar.rathod 7-Apr-14 4:38am    
i provided the list of this class to data grid as data source i got two columns
1 is "_prp_A" with value and 2nd is "_prp_ASpecified" with check box in grid.
why "_prp_ASpecified" this is coming?
OriginalGriff 7-Apr-14 5:02am    
No, what does the Class View pane in Visual Studio say? It's the "real arbiter" - and if it says the property exists, right click it and select "goto definition" which will take you to the code that creates it.
CHill60 7-Apr-14 18:57pm    
Don't know why you were downvoted... countered

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900