1
我需要一些幫助。這是我的情況:Telerik Radgrid層次細節網格編輯不更新綁定列表
我有一個綁定列表,其中包含另一個綁定列表,我用它作爲數據源。下面是一個例子:
對象:
public class test
{
public string name { get; set; }
public BindingList<childs> childlist { get; set; }
}
public class childs
{
public string childname { get; set; }
}
我通過填充碼我radgrid控件。以下是預覽:
private void form_Load(object sender, EventArgs e)
{
BindingList<test> testlist = new BindingList<test>();
/** I populate my list with data. I wont show this here. After the list is populated: **//
this.raggrid.MasterTemplate.Columns.Clear();
this.raggrid.MasterTemplate.AutoGenerateColumns = true;
this.raggrid.MasterTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
this.raggrid.MasterTemplate.Columns.Add(new GridViewTextBoxColumn("name", "name"));
GridViewTemplate template = new GridViewTemplate();
this.raggrid.Templates.Add(template);
template.Columns.Add(new GridViewTextBoxColumn("name", "childname"));
template.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
GridViewRelation relation = new GridViewRelation(this.raggrid.MasterTemplate, template);
relation.ChildColumnNames.Add("childlist");
this.raggrid.Relations.Add(relation);
this.raggrid.DataSource = testlist;
}
填充步驟工作正常。但是現在,當用戶編輯細節網格(從代碼中命名模板)時,我必須相應地更新綁定列表(從代碼中命名爲testlist)。當我編輯子網格時,我似乎無法觸發事件。我如何實現這一目標?
注:這是一個winform應用
PS:當我更新的主模板如預期的那樣綁定列表就會自動更新,但是當我更新我的詳細使用的模板,它不更新的招標名單。
感謝,
佳日