2
と表示されていません。 BrowseableAttributes NONEカテゴリにBOTH/TWO CategoryAttribute`sがある場合は表示されます。複数のカテゴリは、私が2つのカテゴリーでPropertyGridのを持っている属性
なぜですか?
public class Customer
{
[DisplayName("first name...:")]
[Category("Customer Test 1")]
public string FirstName { get; set; }
[DisplayName("number...")]
[Category("Customer Test 1")]
public int Number { get; set; }
[DisplayName("wage...:")]
[Category("Customer Test 2")]
public int Wage { get; set; }
[DisplayName("description...:")]
[Category("Customer Test 1")]
public string Desc { get; set; }
[DisplayName("shit...:")]
[Category("Customer Test 1")]
public string Nonsens { get; set; }
}
public Form1()
{
InitializeComponent();
Attribute[] attributes = new Attribute[]{ new CategoryAttribute("Customer Test 1"), new CategoryAttribute("Customer Test 2") };
propertyGrid1.BrowsableAttributes = new AttributeCollection(attributes);
propertyGrid1.PropertySort = PropertySort.Categorized;
propertyGrid1.ToolbarVisible = true;
propertyGrid1.SelectedObject = new Customer() { FirstName = "Bernd", Number = 100, Desc =
"steine", Wage = 3333, Nonsens = "crap" };
}
制限が見つかりました。http://social.msdn.microsoft.com/Forums/en-US/winformsdesigner/thread/707ebb7f-0a76-40d9-9e0c-31183d454d90それを知っていますか?プロパティグリッドに何らかの言い方でアノテートされているプロパティのみを表示することは可能ですか?他の方法では丸め... – msfanboy
これは正確です。TypeConverter.GetProperties()をチェックしてください。 –
申し訳ありませんハンス、何が正確ですか? – msfanboy