Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / Design Time / February 2006

Tip: Looking for answers? Try searching our database.

How does PropertyGrid implement multi select?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bgm - 14 Feb 2006 11:51 GMT
When using the propertygrid (in Visual Studio or the property grod
control), it allows for us to edit properties of multiple objects.
Now, let's say we have two textboxes TextBox1 and TextBox2 with
TextBox1.Visible = false and textBox2.Visible = true;
Now, let's say we are editing both these textboxes ( multiselect ), in
the propertygrid --a "blank" value is shown for the Visible property
(since the property values differ). Note that, the UITypeeditor (if
any) shows up correctly.

Obviously, the property grid is checking if the values differ and
showing a "blank" string.

I have a scenario, where I need to show a "blank" value for primitive
types in the property grid. The scenario is NOT a multi-select case
though.
I want to do something similar with the certain properties( of
primitive types bool, int, double etc) of my Custom Control. These
properties do NOT have a reasonable default value at design-time and I
would like to display the a "blank" value at design-time. But, i do not
want to loose the typeeditors (like the boolean drop-down list) that is
provided by the type.

Since the property grid is capable of such behaviour (showing "blank"
depending on a bool), is there support in the .NET framework for me to
implement this behaviour explicitly(via TypeConverters)?

For Example:
I have a property
public double MyProperty
{
get ; set;

}

and I have a bool DoesMyPropertyHaveADefault - to determine whether the
property grid should show a "blank" value. This bool can be maintained
internally.

Bgm
jokiz - 15 Feb 2006 10:09 GMT
try to explore the MergablePropertyAttribute

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.