DataItem on grd_RowDataBound

  • Thread starter Thread starter Paulo
  • Start date Start date
P

Paulo

Hi, how do I retrieve the e.Row.DataItem.ItemArray[] on the code? Because I
need to retrieve the value of one field wich comes from the source wich is
binded to grid...

I found it debugging when the mouse is over the e.row.DataItem!

using asp.net 2.0 C# VS2005

Thank you very much!
 
Hi, how do I retrieve the e.Row.DataItem.ItemArray[] on the code? Because
I need to retrieve the value of one field wich comes from the source wich
is bound to grid...

You don't need ItemArray[] for this...

protected void gvHistory_RowDataBound(object sender, GridViewRowEventArgs
e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
string strTextFromDB =
((DataRowView)e.Row.DataItem)["FieldFromDB"].ToString();
}
}

Thanks Mark! It worked!
 
Back
Top