在GridView中查找列值

时间:2013-06-29 18:21:18

标签: asp.net gridview datarowview

我想从(Description)获取专栏DataRowView。我有以下代码。

protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
        {

            if (e.Row.DataItem != null)
            {
                DataRowView dataRowView = ???????????
                string description = dataRowView["Description"] as string;
            }

        }

如何使用适当的代码替换??????????

1 个答案:

答案 0 :(得分:0)

使用(DataRowView)e.Row.DataItem;