0
我有添加項目到DataGrid一個非常簡單的形式。這是問題孩子,作品第一次有人點擊按鈕添加的項目組合框,但隨後的點擊不會爲選擇的值返回任何值:Silverlight的組合框不重新綁定
<ComboBox SelectedValuePath="Content" SelectedValue="{Binding Mode=TwoWay, NotifyOnValidationError=True, Path=NewResource.ResourceType, ValidatesOnExceptions=True}" Grid.Row="2" Grid.Column="1" Margin="0,10,0,0">
<ComboBoxItem Content="AV" />
<ComboBoxItem Content="Room Setup" /></ComboBox>
這裏是視圖代碼 - 模型,添加資源:
if (NewResource.Name != string.Empty)
{
ProposalResource _pr = new ProposalResource()
{
CreatedBy = App.UserID,
CreatedOn = DateTime.Now,
ModifiedBy = App.UserID,
ModifiedOn = DateTime.Now,
Name = NewResource.Name,
ProposalID = CurrentProposal.ProposalID,
Quantity = NewResource.Quantity,
ResourceType = NewResource.ResourceType
};
CurrentProposal.ProposalResources.Add(_pr);
ctx.SubmitChanges();
NewResource.Name = "";
NewResource.Quantity = null;
NewResource.ResourceType = null;
RaisePropertyChange("NewResource");
}
我的問題是,這適用於第一次插入。資源類型從組合框中拾取,一切正常。但隨後的點擊不會返回任何選定的值。是否有任何理由爲什麼後續請求不會選擇雙向綁定?