473,322 Members | 1,425 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Hiding a row in a PropertyGrid

Is it possible to hide a row within a PropertyGrid based upon the boolean
value of another row within the PropertyGrid? I am using VS2005 with .NET
Frameworks 2.0.

--
-----------
Thanks,
Steve
Jul 12 '07 #1
3 4312
Hello SteveT,

see this discussion: http://www.dotnet247.com/247referenc...33/165462.aspx
Is it possible to hide a row within a PropertyGrid based upon the
boolean value of another row within the PropertyGrid? I am using
VS2005 with .NET Frameworks 2.0.

Jul 12 '07 #2
Hi Steve,

This is not a trivial task. PropertyGrid exposes no interfaces to
manipulate its UI by removing/adding rows. Normally, PropertyGrid will use
Reflection to query the type/value on the SelectedObject and display one
property for a row. There is no easy way to tell PropertyGrid not to
display any row or add one row. PropertyGrid is not designed with this
function.

If you really want to achieve this task, one workaround is hooking into the
Reflection process of PropertyGrid during querying the object types/values.
Before PropertyGrid queries the properties, it will first query if the
object implement ICustomTypeDescriptor interface. So we can use this
interface as a hook to dynamically add/remove properties.
The codeproject article below demonstrates this technology:
"Add (Remove) Items to (from) PropertyGrid at Runtime"
http://www.codeproject.com/cs/miscct...opertygrid.asp

Note: this technology needs the modification to the selected object instead
of the PropertyGrid class.

Hope this helps.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 12 '07 #3
Actually - I seem to recall that you can do this by adding a custom
property-tab and simply tweaking the PropertyDescriptorCollection;
various examples on the net... removing is simpler... to add you need
to create your own PropertyDescriptor. Plenty of examples of that
also.

Marc
Jul 12 '07 #4

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

Similar topics

6
by: Terry | last post by:
I have a very basic program, but for some reason I can't get it to behave properly. What I want is a basic form with a TabControl that fills the entire form. The tab control should have 4 tabs...
3
by: Dave Girvitz | last post by:
I have a PropertyGrid (Windows Forms App) based component that uses TypeConverters to generate ranges of acceptable values for properties. The idea was that I could download the key/value pairs...
1
by: ANDRES BECERRA | last post by:
Herfried K. Wagner was kind enough to point me to the PropertyGrid control http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemwindowsformspropertygridclasstopic.asp I have found a few...
1
by: Lance | last post by:
Is there any way to tell a Windows.Forms.PropertyGrid to update the values for the properties that it is displaying? I am having trouble getting the PropertyGrid to update when I make changes to...
7
by: siddhiash | last post by:
Hi Friends I want to add PasswordChar Property which shows ****** for string which I type in PropertyGrid Control. Regards, Siddharth
6
by: Steve Teeples | last post by:
Can someone show me an example of how to place a "CheckedListBox" property within a PropertyGrid? -- ----------- Thanks, Steve
5
by: Sharon | last post by:
I'm using the PropertyGrid control, and I want it to show a button. But I set the PropertyGrid.SelectedObject with a object that as a Button property, the PropertyGrid shows the buttons properties,...
4
by: phcmi | last post by:
I have a PropertyGrid question. My task is to replace a legacy dialog box presentation with a modern one. The dialog itself allows the user to set configuration settings in our application, so...
5
by: Jon Pope | last post by:
I've got a class which contains properties. I can supply this class to the Properties control, and it will properly display the properties and allow the user to edit them, etc. I would like to be...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.