Display multiple objects in property grid
Array selected = Array.CreateInstance(typeof(Object), (this.designer1.DesignerHost.GetService(typeof(ISelectionService)) as ISelectionService).SelectionCount);
(this.designer1.DesignerHost.GetService(typeof(ISelectionService)) as ISelectionService).GetSel开发者_StackOverflowectedComponents().CopyTo(selected, 0);
_PropertyGrid.SelectedObjects = new object[] {selected};
I am trying to display multiple objects in the PropertyGrid, what am I doing wrong?
Found my answer myself :)
_PropertyGrid.SelectedObjects = (selected as object[]);
does the job ;)
精彩评论