Changing the look of the Invalid Property Value warning in a PropertyGrid?

R

Robert Hooker

I know that this question has been batted around here for a while - and I
know that sample code, using reflection and poking around inside the
propertygrid class, has been posted by a kind soul.... but I'm really
hoping that someone on the Forms team, or C# team at Microsoft can have a go
at answering this.

Q: When inside a property grid, I am throwing exceptions when a value is out
of range for a cell.

All works well - I get the "Invalid Property" box appearing... Except that
the 'juicy' bit of my out-of-range warning is hiden by the "Details" button
on the Invalid Property Value box that the grid shows...

Is there any (semi-official) way of getting it to show a different box, or
at least to have the 'Details' shown by default?
 
Y

Ying-Shen Yu[MSFT]

Hi,

I don't think we provided the "official" way to customize that error box.
If you wish to have this feature, you may post the suggestions to our
MSWish program

http://register.microsoft.com/mswish/suggestion.asp

For now, you may try customizing it by reflection, if you have any problem
, please
be free to reply this thread. Maybe you can get a work around in this
group, although not "official".
:)


Best regards,

Ying-Shen Yu [MSFT]
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, "online" should be removed before
sending.
 
I

Ivo Kovacka

I think i have seen that it is possible. Have you looked for it with google.
I cannot remember where it was, but the solution shown something else.

Regard, ifko
 
Y

Ying-Shen Yu[MSFT]

Hi Ivo,

If you mean this link , I think that's what I mentioned the "reflection"
approach, unfortunately, there is no documented way to do it.

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=9ae5f5f3
0303240858.36b04e64%40posting.google.com&rnum=1&prev=/groups%3Fq%3DInvalid%
2BProperty%2Bdialog%26ie%3DUTF-8%26oe%3DUTF-8%26hl%3Den

If not, maybe you can give me the thread linke to it, I'm happy to learn
something new about it. Thanks!

Best regards,

Ying-Shen Yu [MSFT]
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, "online" should be removed before
sending.
 
R

Robert Hooker

Yes - Robert Grubbs very kindly posted a sample of his code, which he
alledges does the trick.

http://groups.google.com/[email protected]&rnum=2

We have implemented this similarly at our end, but have not gotten it to
work correctly all the time. We are seeing the new error boxes just fine,
but our reflection code is breaking the appearance of other UITypeEditors
which popup or drop down.

We are not sure if its our code, or if the same above worked only in .NET
v1.0, and not in V1.1...

Grumble mutter grumble....

Is there any way at all that someone ofn the Microsoft framework team (or
someone who implemented the property grid) can maybe give me a hint as to
what might be going on?

Rob.
 
Y

Ying-Shen Yu[MSFT]

Hi Robert,

Sorry for the late response. I contacted our product group on this issue.
The clear reply from the Program Manager Tech Lead of .NET Client Team is
that using private reflection to alter the internal behavior of Windows
Forms classes is not supported by Microsoft. Our strong recommendation
would be to not do this.

We are sorry to bring you this inconvenience, it's a limitation in the
PropertyGrid control, I have sent your feedback to the product team to let
them know this request.

Thanks a lot for your understanding!

Best regards,

Ying-Shen Yu [MSFT]
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security

This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, "online" should be removed before
sending.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top