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 / Windows Forms / WinForm Controls / January 2008

Tip: Looking for answers? Try searching our database.

PropertyGrid Property Dependency

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Derek Hart - 21 Jan 2008 22:16 GMT
I am creating some properties, duplicating what is in an Infragistics label.
Pretty sure Infragistics will not help me on this one. I am using 3
properties, BackColor, BackColor2, and BackGradientStyle.  If both BackColor
and BackColor2 are filled in, the BackGradientStyle uses a gradient to mix
the 2 colors together. Now when using this in Visual Studio, the
BackGradientStyle property is related to BackColor and BackColor2, because
when BackColor and BackColor2 have colors chosen, the BackGradientStyle
dropdown shows the how the gradient will look with the colors chosen. There
is some attribute most likely relating the properties together.  I know the
PropertyGrid has many abilities, but I would appreciate a code sample if
somebody knows how these might be related.

Thank You!
Derek
Claes Bergefall - 22 Jan 2008 10:18 GMT
That's a custom editor and not part of the propertygrid itself. Check out
the EditorAttribute and UITypeEditor classes.

The Infragistics editor used for the BackGradientStyle property is called
Infragistics.Win.Design.GradientStyleEditor. It's not documented but if you
download .NET Reflector (top of page at http://www.aisto.com/roeder/dotnet/)
you can always decompile it and take a look at the code.

  /claes

>I am creating some properties, duplicating what is in an Infragistics
>label. Pretty sure Infragistics will not help me on this one. I am using 3
[quoted text clipped - 10 lines]
> Thank You!
> Derek
VisualHint - 22 Jan 2008 15:45 GMT
Derek,

There is no way to relate a property directly to another. If you want
to redraw the gradient property when the back colors change, then use
a RefreshProperties attribute on the back color properties. If your
question is more about "how does the dropdown accesses the back color
properties" then you can simply use the target instance passed with
the context object (inside your UITypeEditor.EditValue method) to
access the color properties.

Best regards,

Nicolas Cadilhac @ VisualHint (http://www.visualhint.com)
Home of Smart PropertyGrid for .Net and MFC (http://www.visualhint.com/
index.php/propertygrid)
Microsoft PropertyGrid Resource List - http://www.propertygridresourcelist.com
Home of Smart FieldPackEditor.Net / DateTimePicker replacement (http://
www.visualhint.com/index.php/fieldpackeditor)

> I am creating some properties, duplicating what is in an Infragistics label.
> Pretty sure Infragistics will not help me on this one. I am using 3
[quoted text clipped - 9 lines]
> Thank You!
> Derek

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.