2011-05-05 6 views
0

Visual Studio 편집기의 드롭 다운 목록을 통해 DataSource 필드를 편집 할 수있는 [AttributeProvider (typeof (IListSource))] 태그가 있습니다. 동일한 태그를 사용하여 동일한 방식으로 DataMember 속성을 편집 할 수 있습니다. 지금 내가 사용하는 결국Visual Studio 디자이너에서 사용자 정의 컨트롤의 데이터 멤버

[AttributeProvider(typeof(IListSource))] 
    public object DataSource 
    { 
     get 
     { 
      return this.dataSource; 
     } 

     set 
     { 
      this.dataSource = value; 
      BindTextBox(); 
     } 
    } 

    [Editor("System.Windows.Forms.Design.DataMemberFieldEditor", typeof(System.Drawing.Design.UITypeEditor))] 
    public String DataMember 
    { 
     get 
     { 
      return this.dataMember; 
     } 

     set 
     { 
      this.dataMember = value; 
      BindTextBox(); 
     } 
    } 

답변

0

... 내가 필드 이름을 계속 찾고해야하는 경우 시간이 많이 걸릴 DataMember를위한 값을 입력해야 [검색 가능한 (사실)]. 이 필드를 텍스트 필드로 편집 할 수 있지만 드롭 다운 메뉴는 표시되지 않습니다.