Internet Explorer中的NullReference ItemDataBound

问题描述

我想问一下,ItemDatabound中的代码在IE 11.0.9600.18538中具有空引用。 这是我的NullReference代码

if (e.Item is GridDataItem)
    {
        GridDataItem dataItem = (GridDataItem)e.Item;

        if ((!dataItem["Status"].Text.Equals("DONE") && !dataItem["Status"].Text.Equals("ALMOST DONE")))
        {
            dataItem["BtnUpdate"].Controls[0].Visible = false;
            (dataItem["Delete"].Controls[0] as Button).Attributes["onclick"] = null;
        }
    }

在此代码中,仅在IE版本11.0.9600.18538中具有错误NullReference。

(dataItem["Delete"].Controls[0] as Button).Attributes["onclick"] = null;

在IE版本11.0.9600.18538中,此按钮不显示

dataItem["BtnUpdate"].Controls[0].Visible = false;

这是我的aspx代码,它在后面的代码调用

 <telerik:GridButtonColumn UniqueName="Delete" ButtonType="FontIconButton" CommandName="Delete" ConfirmText="Are you sure you want to send this deletion for approval?" ConfirmDialogType="radwindow"/>

基于我的代码,我想在状态为“已完成”和“即将完成”时显示确认,但在状态为“草稿和待处理”时不显示。 所有代码都可以在IE更新版本和Google Chrome中正常工作。

任何人都可以帮忙吗?预先感谢!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...