private void occuranceListBox_SelectedIndexChanged(object sender, EventArgs e) { DataEntryCollection data = message.Data[occuranceListBox.SelectedIndex]; if (data.Count == 0) { noPropertiesTextBox.Visible = true; messagePropertyGrid.Visible = false; } else { messagePropertyGrid.SelectedObject = message.Data[occuranceListBox.SelectedIndex]; noPropertiesTextBox.Visible = false; messagePropertyGrid.Visible = true; } }
public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes) { DataEntryCollection d = value as DataEntryCollection; return(new PropertyDescriptorCollection(Array.ConvertAll <DataEntry, DataEntryPropertyDescriptor>(d.ToArray(), delegate(DataEntry input) { return new DataEntryPropertyDescriptor(input, d.Parent); }), true)); }