Prod.: Engine, ver.: 6, ID: 60001231, HowTo : How do I show a selection set in a Microsoft PropertyGrid control ?

HowTo : How do I show a selection set in a Microsoft PropertyGrid control ?

Article60001231
TypeHowTo
ProductEngine
Version6
Date Added9/24/2010
Submitted byR K Verma
Keywords

Subject

How do I show a selection set in a Microsoft PropertyGrid control ?

Summary

I need to use a Microsoft PropertyGrid control in my application and show the VDF informations but when I pass to it a selection set I don't get the results that I get when I use your vdPropertyGrid. How do I do this ?

Solution

You can add in a form a System.Windows.Forms.PropertyGrid control named PropertyGrid1 (this is a Microsoft .NET component) and a button and use a code like the below in the button click :
vdFramedControl1.BaseControl.ActiveDocument.CommandAction.CmdSelect("USER"); //select some entities in the drawing
VectorDraw.Professional.vdCollections.vdSelection sel = vdFramedControl1.BaseControl.ActiveDocument.Selections.FindName("VDRAW_PREVIOUS_SELSET");
object[] arr = new object[sel.Count]; int i = 0;
foreach (VectorDraw.Professional.vdPrimaries.vdFigure var in sel)
{
    arr.SetValue(var, i);
    i++;
}
propertyGrid1.SelectedObjects = arr;
and you will see that this microsoft control will display properly the properties and objects.