【问题标题】:Telerik Radgrid hierarchical detail grid edit not updating binding listTelerik Radgrid 分层详细信息网格编辑不更新绑定列表
【发布时间】:2011-10-16 20:29:03
【问题描述】:

我需要一些帮助。这是我的情况:

我有一个绑定列表,其中包含另一个我用作数据源的绑定列表。下面是一个例子:

对象:

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:当我更新主模板时,绑定列表会按预期自动更新,但是当我更新我用作详细信息的模板时,它不会更新投标列表。

谢谢,

亚什

【问题讨论】:

    标签: c# telerik hierarchy edit radgrid


    【解决方案1】:

    对于任何有类似问题的人,这里是解决方案:

    Solution

    唯一的问题是我使用了 CellValueChanged 事件而不是 RowsChanged。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-10-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多