每行都有System.Data.DataRowView [英] System.Data.DataRowView in every row

查看:59
本文介绍了每行都有System.Data.DataRowView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

protected void rgPeriodic_ColumnCreated(object sender, Telerik.Web.UI.GridColumnCreatedEventArgs e)
    {
        DataSet ds2 = new DataSet();
           ds2 = DataAccessLayer.BindDataQuery("select *  from FLASitesData where FLANO='1' order by SrDate desc ");
        if (e.Column.UniqueName == "flano")
        {
            GridBoundColumn boundColumn = e.Column as GridBoundColumn;

            boundColumn.DataField = ds2.Tables[0].Rows[0]["PresentAmps"].ToString();
            
        }
    }



我的问题是在if语句之后,它没有进入语句并在<$ c $中c> radgrid 列每行显示 System.Data.DataRowView



如何解决?


My problem is after the if statement, it is not entering into the statement and in radgrid column it is showing System.Data.DataRowView in every row.

How can I solve it?

推荐答案

如果没有定义更晚的覆盖,ToString将使用默认的对象实现。 DataRowView没有实现ToString,因此返回了Type名称的默认返回值。



您可能想要选择行中的项目并返回 - 但我会首先在调试器中查看ds2.Tables [0] .Rows [0] [PresentAmps]实际上是先返回。
ToString uses the default object implementation if no later override is defined. DataRowView does not implement ToString, so the default return of the Type name is returned.

You probably want to select an item within the row and return that - but I would start by looking in the debugger at what ds2.Tables[0].Rows[0]["PresentAmps"] is actually returning first.


这篇关于每行都有System.Data.DataRowView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆