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 / WinForm General / February 2007

Tip: Looking for answers? Try searching our database.

Need help on some PropertyGrid and PropertyGridView members

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Helen.K - 10 Feb 2007 14:54 GMT
Hi,
I'm looking for a way to test the application with the PropertyGrid control,
namely, to programmatically obtain grid items, select items, etc.
I explored the PropertyGrid object with the test tool and found a number of
protected (or maybe even private) members that I guess can help me with my
task. The problem is, these members are not documented in MSDN. I tried
Google search but haven't found anything on these members either.
Well, the purpose of some of them, e.g. PropertyGrid.GetPropEntries(), or
PropertyGridView.SetExpand (GridEntry, boolean) is obvious. However, I got
stuck trying to understand what the others do.

Could anyone provide me some information on these methods and their
parameters?
Thanks in advance,
Helen

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 Methods of the PropertyGrid class:

boolean   GetScrollState (int)
int       GetSelectState()
boolean   GetState (int)
void      SetSelectState (int)
void      SetState (int, boolean)

 Methods of the PropertyGridView class:

GridEntryCollection   GetAllGridEntries (boolean)

int       CountPropsFromOutline (GridEntryCollection)
int       GetGridEntriesFromOutline (GridEntryCollection, int, int,
GridEntry[])
GridEntryCollection   GetGridEntryHierarchy (GridEntry)

GridEntry FindEquivalentGridEntry (GridEntryCollection)

int       GetCurrentValueIndex (GridEntry)
int       GetPropertyLocation (String, boolean, boolean)
boolean   GetState (int)

void      RecursivelyExpand (GridEntry, boolean, boolean, int)
void      SelectGridEntry (GridEntry, boolean)
void      SetState (int, boolean)
void      SelectEdit (boolean)
Andrew McNab - 11 Feb 2007 13:17 GMT
>   Methods of the PropertyGrid class:
>
[quoted text clipped - 3 lines]
> void      SetSelectState (int)
> void      SetState (int, boolean)

With these Protected methods above in particular, they're used by the
Control or the Control's parent internally for GUI purposes. They're not
meant for use during run time for any designed purpose except for the
Application to surf through control handles and use the events for rendering
the control's based on the control's current state etc.

I haven't used the PropertyGrid control before but by the looks of some of
the methods you listed below, most of them are Protected for internal handle
use. Some method names like RecursivelyExpand (GridEntry, boolean, boolean,
int) actually have run time public versions which expand TreeView controls
that exist inside the PropertyGrid control.

Anything that's documented as Private is generally not documented at all
and, at most, only the method name is documented. Mainly because there is no
way you can break the type saftey of the class to execute the private methods.

The Heirarchy of Class access and execution is:

Public - Any external class can execute this method or access this property

Protected - Only Authorised (Generally .Net Framework Engine Only) classes
can access these methods and properties

Private - No chance at all to access these methods or properties.

If you are intending on using Protected methods or members, you can use
unmanaged code to access them through the .Net marshal. I've never done this
for controls. Before .Net 2005 came out, I used to use the Marshal to access
COM ports with unmanaged C++ code within C# managed code applications.

Hope this is of any use at all :o)
Helen.K - 12 Feb 2007 11:18 GMT
Hi Andrew,
Thanx for the info.

Actualy, I know about the access types, and that it's impossible to call
protected/private members from the application source code. However, I CAN
call the internal members from scripts created in out test automation tool,
indeed (you see, it provides access to all members of application's objects,
even those which are protected and private). I already found some of the
internal methods of these objects very useful when implementing a part of the
needed test functionality. For example, I was able to determine coordinates
of a particular property value cell, or coordinates of the "+"/"-" buttons
(in order to simulate mouse clicks on them then), and so on. As to the listed
above methods, I looked at their names and thought they might be helpful
too...

BTW, I've found a way to learn the purpose of these methods. At the moment,
I'm trying .NET Reflector to do the reverse engineering. It works excellent,
so I can see the decompiled code and finally understand what these methods do
and if they can be helpful for me (and if I don't break anything by using
some of them :-) ).

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.