473,508 Members | 2,382 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Validating a "PropertyGrid" row

Hi there,

I've got an "int" property in one of my objects that I need to conduct a
range check on in a "PropertyGrid" (whenever the user attempts to leave the
row). I know how to do this using the "TypeConverterAttribute" for
user-defined types but I'm not sure how to handle it for built-in types like
an "int". Can anyone provide any insight. Thanks.
Feb 28 '07 #1
2 2795
Hello John,
>I've got an "int" property in one of my objects that I need to conduct a
range check on in a "PropertyGrid" (whenever the user attempts to leave
the row). I know how to do this using the "TypeConverterAttribute" for
user-defined types but I'm not sure how to handle it for built-in types
like an "int". Can anyone provide any insight. Thanks.
If your property can only be set to ints in a certain value range, you
should be throwing an exception from the property setter, right? This is
automatically evaluated by the PropertyGrid and an error dialog shown.
Oliver Sturm
--
http://www.sturmnet.org/blog
Mar 4 '07 #2
If your property can only be set to ints in a certain value range, you
should be throwing an exception from the property setter, right? This is
automatically evaluated by the PropertyGrid and an error dialog shown.
Thanks very much. I didn't realize it was that simple. After working with
the "PropertyGrid" for several weeks now, I've seen no documentation
whatsoever that indicated this. Now that I'm actually looking at the
"PropertyDescriptor.SetValue" method in MSDN however, it does in fact
mention it (though no mention is made of the "PropertyGrid"). In any case,
thanks again (appreciated).
Mar 4 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1843
by: Dave | last post by:
Hi everyone, (I already posted this to the VS.NET IDE news group without any responses, so I'm attempting one more time in this group) The issue I'm having is occuring in the IDE of VS.NET...
10
3203
by: Özden Irmak | last post by:
Hi, I'm trying to hide an event of my custom usercontrol derived control, something like "Shadows" in VB.Net, but although the event is hidden from PropertyGrid, from CodeEditor I can still...
3
2317
by: phil cunningham | last post by:
I see Property Inspectors all over Visual Studio, Is this class available for use to allow users to Modifiy my data structures. If anyone knows I'd appreciate it
10
3363
by: jaire | last post by:
In my application I have two threads. Each of them creates a new propertygrid. In the property grid I have a property with a color editor. Whenever i am clicking on the combo box to change the...
2
3401
by: Steve Teeples | last post by:
Someone introduced me to PropertyGrid last night. It is a great feature for what I need. A question though. I noticed that when I assign a "TextBox" control to a property grid the description on...
0
987
by: Sam Malone | last post by:
In VB.NET 2005, when I load up a PropertyGrid and the object it refers to contains "collections" of other items, clicking on the ellipsis for that collection brings up an editor in which I can...
0
983
by: Rob Peterson | last post by:
Does anyone know if this is possible. Thanks.
6
3877
by: Larry Smith | last post by:
Hi there, Can anyone provide any insight on why MSFT introduced "TypeConverter.GetProperties()". There are two classes for dealing with metadata in .NET, 'Type" and "TypeDescriptor". Each has a...
1
1077
by: shawncraig | last post by:
I like the "properties window" control in SQL 2005 and I want to know if this or something close to it exists for use in my VB.NET app I'm building? You know the 2 column grids that are...
0
7133
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7336
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7405
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7066
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7504
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5643
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3214
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3198
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
435
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.