좋아, 나는이 두 가지를 수행하여 작동시킬 수 있었다 : 사전이 자식 폼에 널 사전을 자식 폼에 전달보다는 초기화하기 전에 초기화되어 있는지 만들기
1).
2) 자식 폼이 닫힐 때 사전을 다시 그리드의 데이터 소스에 할당. 여기
는 부모 폼에 대한 코드는 행동을 보여주고있다 :
private void addColorCodeLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
var assignedColorCodes =
(Dictionary<string, string>)this.subtypeColorCodesUltraGrid.DataSource;
//Initialize a null dictionary so that SubtypeColorCodeForm will reference the same dictionary.
if (assignedColorCodes == null)
assignedColorCodes = new Dictionary<string, string>();
SubtypeColorCodeForm.ShowForm(this, new ImageServerProxy(this.tbImagingUri.Text),
assignedColorCodes);
//Assign the updated dictionary back to the data source.
this.subtypeColorCodesUltraGrid.DataSource = assignedColorCodes;
}
당신이 코드의 일부를 보여 주시겠습니까? 하위 폼을 열고 사전을 전달하는 부분. – Steve
응답 해 주셔서 감사합니다, 스티브. 나는 그것을 작동시키고 아래의 해결책을 게시 할 수있었습니다. – lintmouse