DataItem on grd_RowDataBound

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!
 
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 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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top