【问题标题】:Editing control inside Row Edit Template在行编辑模板内编辑控件
【发布时间】:2013-08-28 17:34:36
【问题描述】:

您好,我目前正在尝试将数据加载到 RowEditTemplate 的控件之一中。

我在所述模板中有一个常规的 ASP.NET DropDownList。此列表应加载来自 List 的数据,其中 MyObject 具有 Id 和 Name。
我已经搜索了很长时间,但似乎无法找到一种方法来从后面的代码中获取此列表并加载所述数据。

欢迎大家帮忙,谢谢

【问题讨论】:

    标签: c# .net infragistics webdatagrid


    【解决方案1】:

    好吧,果然来自幸运女神(?),问了一会儿我找到了答案。

    为了从 RowEditingTemplate 中获取控件,您首先需要访问相关模板。所以,为了回答我自己的问题,为了得到我的清单,我做了:

    DropDownList ddlMyObjects = (DropDownList)WebDataGrid1.Behaviors.EditingCore.Behaviors.RowEditTemplate.TemplateContainer.FindControl("control_MyObject");
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-08-03
      • 1970-01-01
      • 2015-02-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多