天天看點

Dev PropertyGridControl控件 移除某一Category下的屬性

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;
            }
        }
           

繼續閱讀