私はPropertyGrid of Xceedを使用していくつかの要素の特性を表示しています。要素には、一般、高度、その他、特殊など、さまざまなカテゴリがあります。ここでは、Xceedのプロパティグリッドがアルファベット順にプロパティと同様にカテゴリをソートすることがわかりました。 [PropertyOrder(n)]
を使用してカテゴリ内のプロパティを並べ替えることができました。私もそうなカテゴリをソートしたかった、私は[CategoryOrder("General", 0)]
ようCategoryOrder
を使用してみましたが、それは次のようなエラーが表示されます。カテゴリXceed PropertyGridでの注文
Error 2 Attribute 'CategoryOrder' is not valid on this declaration type. It is only valid on 'class' declarations.
私はそれが間違って使用していますか? 以下のコードは、これをどのように使用しているかを示すサンプルです。ここで
[Category("General")]
[CategoryOrder("General", 0)]
[DisplayName("XValue")]
[Description("Value of X-Coordinate")]
[ReadOnly(true)]
[PropertyOrder(1)]
[Category("Advanced")]
[CategoryOrder("Advanced", 1)]
[DisplayName("Collision")]
[Description("Collision")]
[ReadOnly(true)]
[PropertyOrder(1)]
[Category("Others")]
[CategoryOrder("Others", 3)]
[DisplayName("Traffic")]
[Description("Traffic at a point")]
[ReadOnly(true)]
[PropertyOrder(1)]
[Category("Special")]
[CategoryOrder("Special", 2)]
[DisplayName("Special cases")]
[Description("Contains the special cases and files")]
[PropertyOrder(1)]
はありがとうございました!それは完璧に働いています。 – Skaranjit
あなたは大歓迎です! – jsanalytics