Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / September 2006

Tip: Looking for answers? Try searching our database.

Datagridview, object datasource, and hiding properties via attribu

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
William Sullivan - 14 Sep 2006 17:28 GMT
I seem to remember this being possible, but I can't find a single thing about
it now..

I have a datagridview that is bound to a bindinglist of type 'foo'.  Foo is
a business object with a number of public attributes.  

I want to prevent the datagridview from binding to some of these public
attributes.  I can do it in the datagridview, but as I remember, there are
some attributes that I can apply to the public attributes in Foo that will
change how they bind to the datagridview.  Is my memory faulty?  If not, can
you give me some of the attributes so that I can search on those?  TIA.

It might be that I'm mixing up the datagridview with the property grid,
which does use reflection to examine the attributes of public properties in
the object that is bound to the property grid....
Frans Bouma [C# MVP] - 14 Sep 2006 17:49 GMT
> I seem to remember this being possible, but I can't find a single
> thing about it now..
[quoted text clipped - 12 lines]
> grid, which does use reflection to examine the attributes of public
> properties in the object that is bound to the property grid....

    By default the BindingSource filters properties which have the
attribute Browsable(false) applied to them. You can set a different
attribute on the bindingsource if you want. Thought Browsable(false) is
pretty common for this.

        Frans

Signature

------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.