Hi,
I think we may try to iterate throught the propertygrid's item and call the
select method on the first one.
private void button1_Click(object sender, System.EventArgs e)
{
GridItem gi=propertyGrid1.SelectedGridItem;
if (this.propertyGrid1.PropertySort == PropertySort.Alphabetical )
{
GridItem p_gi=gi.Parent;
foreach( GridItem egi in p_gi.GridItems)
System.Diagnostics.Debug.WriteLine(egi.Label);
p_gi.GridItems[0].Select();
}
else
{
GridItem p_gi=gi.Parent.Parent;
foreach( GridItem egi in p_gi.GridItems)
{
System.Diagnostics.Debug.WriteLine("");
System.Diagnostics.Debug.WriteLine(egi.Label);
foreach( GridItem eegi in egi.GridItems)
System.Diagnostics.Debug.WriteLine(eegi.Label);
}
p_gi.GridItems[0].GridItems[0].Select();
}
}
Hope this helps.
Best regards,
Perter Huang
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.