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