【问题标题】:C# Calling edit command in ItemDataBoundC# 在 ItemDataBound 中调用编辑命令
【发布时间】:2011-06-01 14:37:21
【问题描述】:

我目前正在努力寻找我需要在 if 语句中调用的代码,以便找到数据列表的编辑事件。

我正在尝试在现有下拉列表中创建一个空白下拉项。

任何帮助都会很棒!谢谢!

protected void DL_Items_ItemDataBound(object sender, DataListItemEventArgs e)
{
    if ( )
    {
        DropDownList DDL_Designers = (DropDownList)e.Item.FindControl("DDL_Designers");
        DDL_Designers.Items.Insert(0, new ListItem("N/A", "0"));
    }
}

【问题讨论】:

  • if (e.Item.ItemType == ListItemType.EditItem)

标签: c# datalist itemdatabound


【解决方案1】:

试试if (e.Item.ItemType == ListItemType.EditItem)

【讨论】:

    【解决方案2】:
    if (e.Item.ItemType == ListItemType.EditItem)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-12-24
      • 2013-08-28
      相关资源
      最近更新 更多