How to select a GridItem in PropertyGrid?

  • Thread starter Thread starter Arto Viitanen
  • Start date Start date
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?
 
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)
 
Back
Top