The propertygrid shows entries in bold when they are not the default value. For the most part, I don't have any default values for my properties, so they all appear bold. This is very distracting. The idea of showing properties in bold when not default values is not really applicable for my use of the propertygird. Is there any way I can stop the values from ever appearing bold

PropertyGrid DefaultValues
Lonnie Barnett
Saravanakumars38
Hi,
Please try looking at this link. Hope this should help you.
http://msdn2.microsoft.com/en-us/library/aa302326.aspx
Thank you,
Bhanu.
ACHawk
R.Tutus
I looked into the PropertyGrid code and actually it seems there is only one solution. The DefaultValueAttribute is linked to the Serialization mechanism that the Visual Studio designer uses to fill the InitalizeComponent method. I don't know if this is an option for you but the only thing that I see is to disable this mechanism for each of your properties. The following code does the trick for one property:
public class TargetClass
{
bool _myBool = false;
private bool ShouldSerializeBoolean()
{
return false;
}
public bool Boolean
{
set { _myBool = value; }
get { return _myBool; }
}
}
You will notice the ShouldSerializeX method where x is the name of your property. For a formal explanation, look at this page at MSDN.
Hope this helps.
Best regards,
Nicolas Cadilhac
Smart PropertyGrid.Net @ VisualHint
Microsoft PropertyGrid Resource List
Free PropertyGrid for MFC
Dylan Morley
pedestrian
Best regards,
Nicolas Cadilhac
Smart PropertyGrid.Net @ VisualHint
Microsoft PropertyGrid Resource List
Free PropertyGrid for MFC
Gregor Jovan
NET PR