Data Binding

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi,
I have a class with several properties. Property [TWO] has an attribute assigned to it. Now i create a bindingsource and set the datasource to an instance of Test Class and bind the bindingsource to a datagridview.
The browsableattribute is now stopping my datagridview from showing property [TWO] values.
I also bind an instance of Test Class to a property grid. This is the reason for me added the browsable attribute. cause i dont want to see property [TWO] in my property grid.
So, my question is how do i achieve binding in datagridview and not visible in propertygrid. do i need to write a designer and override prefilterproperties or what?

Thanks
Gary
<div style="background-color:white; color:black
<pre> <span style="color:blue Public <span style="color:blue Class Test

<span style="color:blue Private m_one <span style="color:blue As <span style="color:blue String

<span style="color:blue Private m_two <span style="color:blue As <span style="color:blue String



<span style="color:blue Public <span style="color:blue Property ONE() <span style="color:blue As <span style="color:blue String

<span style="color:blue Get

<span style="color:blue Return m_one

<span style="color:blue End <span style="color:blue Get

<span style="color:blue Set(<span style="color:blue ByVal value <span style="color:blue As <span style="color:blue String)

m_one = value

<span style="color:blue End <span style="color:blue Set

<span style="color:blue End <span style="color:blue Property



<Browsable(<span style="color:blue False)> _

<span style="color:blue Public <span style="color:blue Property TWO() <span style="color:blue As <span style="color:blue String

<span style="color:blue Get

<span style="color:blue Return m_two

<span style="color:blue End <span style="color:blue Get

<span style="color:blue Set(<span style="color:blue ByVal value <span style="color:blue As <span style="color:blue String)

m_two = value

<span style="color:blue End <span style="color:blue Set

<span style="color:blue End <span style="color:blue Property



<span style="color:blue End <span style="color:blue Class

[/code]



View the full article
 
Back
Top