How to select a GridItem in PropertyGrid?

A

Arto Viitanen

PropertyGrid has property SelectedGridItem, that lets you get and set
the selected GridItem. Fine, but where do you get the GridItem? I know
you can get sub items of a Griditem by its GridItems property and its
parent with Parent property, but where do you get the initial GridItem?
 
V

VisualHint

Hello Arto,

there is no way to access directly to a property to get its GridItem.
The only way would be to use some sort of reflection hack to access
some internals of the grid or to get the currently selected GridItem,
then use its Parent property recursively to go to the top of the grid
and then browse the entire grid to find the property you want. Not
very efficient, I agree...

Best regards,

Nicolas Cadilhac @ VisualHint (http://www.visualhint.com)
Home of Smart PropertyGrid for .Net and MFC (http://www.visualhint.com/
index.php/propertygrid)
Microsoft PropertyGrid Resource List - http://www.propertygridresourcelist.com
Home of Smart FieldPackEditor.Net / DateTimePicker replacement (http://
www.visualhint.com/index.php/fieldpackeditor)
 

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