Search code examples
asp.netgridviewdatarowview

Finding Column value in GridView


I would like to get the column (Description) from DataRowView.I have the following code.

protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
        {

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

        }

How to replace ?????????? with appropriate code?


Solution

  • Use (DataRowView)e.Row.DataItem;