0
편집 (예 : MemoEdit가)이 사용되어야 정의 할 수있는 기회가의 난이 클래스DevExpress의 PropertyGrid.SelectedObject의 클래스 (내부 편집기) 편집 형을 정의
public sealed class OptionsGrid
{
[Description("Teststring"), DisplayName("DisplaynameTest"), Category("Test")]
public string Test { get; set; }
}
가 있다고 가정 해 보자 클래스 자체의 행? 다음과 같이
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
public sealed class EditorControlAttribute : Attribute
{
private readonly Type type;
public Type EditorType
{
get { return type; }
}
public EditorControlAttribute(Type type)
{
this.type = type;
}
}
public sealed class OptionsGrid
{
[Description("Teststring"), DisplayName("DisplaynameTest"), Category("Test")]
[EditorControl(typeof(RepositoryItemMemoEdit))]
public string Test { get; set; }
}
그런 다음 당신이 PropertyGrid.CustomDrawRowValueCell
에서 설정해야합니다
Propertygrids SelectedObject 당신이 원하는 편집기의 유형을 포함하는 자신의 속성을 정의 할 수 있습니다이
propertyGridControl1.SelectedObject = new OptionsGrid();
감사합니다. 시간을내어 주셔서 감사합니다. – Belial09
'e.Row.Properties.Rowdata! = null'을 메서드의 맨 위로 이동하여 성능을 약간 향상 시켰습니다. – Dmitry
대단히 감사합니다. @Dmitry – Belial09