473,406 Members | 2,894 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

DataItem on grd_RowDataBound

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!
Jun 27 '08 #1
2 2891
"Paulo" <er********@terra.com.brwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
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();
}
}
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jun 27 '08 #2
>
>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!
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mike P | last post by:
I'm having trouble with C# syntax for Container.DataItem. This is the VB version. CAn anybody help me out with the syntax? <asp:DataList runat="server" id="dlResults" Font-Name="Verdana"...
2
by: Tom Lee | last post by:
Hi all, I have the following problem and I cannot solve it. If anyone can help me solve this problem. I use the following code <%#DataBinder.Eval(Container.DataItem, "Property")%> to display...
2
by: ric carrasquilla | last post by:
first, thx to martin for helping me with my initial post. im a newbie and appreciate the help. if someone can help me with another question, please do. i have a repeater pulling job...
5
by: bg | last post by:
Hi! How do I check if "date" exists before using that code? I've built a RSSreader and sometimes there's a date in it and sometimes not. How can I check if it exists to avoid crash...
1
by: Zenobia | last post by:
How do I bind an array, arrayList or even a stack to a repeater containing hyperlinks. The data structure (array, arrayList or even a stack) has dates in ISO format "YYYY-MM-DD". The repeated...
7
by: Mirek Endys | last post by:
Hello, the problem I have now, is: Im binding generic collection based on List<iDB2SQLTransferItem> // iDB2SQLTransferItem is my class // into WebCOntrol DataList. But the DataItem of the...
15
by: Laser Lu | last post by:
Hi, all, I was tangled by the DataGridItem.DataItem property. I tried to invoke that property to get and display the contents that was bound to the currently selected row. However, an exception...
1
by: Nathan Sokalski | last post by:
I need to access one of the columns from the current DataItem in the ItemCommand event, which I call using EventBubbling with a DataList and Button control. The code I tried to use to access the...
3
by: alberthung01 | last post by:
Hi all, I try to use Container.DataItem() in my DataGrid's ItemTemplate. Somewhere it works fine. eg.<input type=checkbox id='cb_select_<%# Container.DataItem("TAG_ID") %>' value='<%#...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.