내가 조회 텍스트 상자에있는 사용자 지정 컨트롤 (Windows Form에)가 있습니다. 컨트롤의 속성은 현재 선택이며 "식별자", "코드"및 "설명"이 포함 된 사용자 지정 개체입니다. 이 속성은 BindingSource를 사용하는 Databound입니다. 정보를 표시데이터 바인딩 사용자 정의 컨트롤
잘 작동합니다. 반면에 OnValidate 또는 OnValueChange를 업데이트 설정 여부에 관계없이 BindingSource를 업데이트하지 않습니다. 자동 업데이트를 위해 누락 된 부분이 있습니까? 정보를 표시
private System.Windows.Forms.BindingSource buildPlanComponentDataBindingSource;
public void LoadBuildPlan(string itemNumber)
{
var buildPlanComponents = BuildPlan.LoadBuildPlanComponents(itemNumber, AutomaticPrice);
buildPlanComponentDataBindingSource.DataSource = buildPlanComponents;
AssemblyNumber = itemNumber;
}
[Bindable(true)]
[DefaultValue(null)]
public ILookupSelection CurrentSelection
{
get
{
if (currentSelection == null)
currentSelection = new LookupSelection {Code = txtLookup.Text};
return currentSelection;
}
set
{
if (value == null) return;
currentSelection = value;
SetText(currentSelection, DisplayText);
SetDescription(currentSelection, DisplayDescription);
}
}
당신은 우리에게 당신이 데이터 바인딩을 만드는 코드를 보여줄 수 있을까? – overslacked
감사합니다. 귀하의 질문은 매우 도움이되었습니다. 어떤 이유로 MSDN 튜토리얼에서는 자습서의 [Bindable (true)] 특성을 사용하지 않았습니다. 중요한 세부 사항입니다! –