private void propertyGridControl1_CustomPropertyDescriptors(object sender, DevExpress.XtraVerticalGrid.Events.CustomPropertyDescriptorsEventArgs e)
{
if (e.Context.PropertyDescriptor == null)
{
PropertyDescriptorCollection filteredCollection = new PropertyDescriptorCollection(null);
foreach (PropertyDescriptor item in e.Properties)
{
//将“雜項”下的屬性移除
if (item == null || item.Category == "雜項") continue;
filteredCollection.Add(item);
}
e.Properties = filteredCollection;
}
}