Getting DataItem from a RepeaterItem

  • Thread starter Thread starter ric carrasquilla
  • Start date Start date
R

ric carrasquilla

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 information from a database. each repeater
itemtemplate has with a linkbutton and a row with a label (for now).

<asp:repeater ID="EmployeeInfo" OnItemCommand="getActivityList"
runat="server">

<itemtemplate>
<tr bgcolor="#CCCCCC">
<td><%# Container.DataItem(0)%></td>
<td><%# Container.DataItem(1)%></td>
<td><%# Container.DataItem(2)%></td>
<td><%# Container.DataItem(3)%></td>
<td><%# Container.DataItem(4)%></td>
<td><asp:linkbutton Text=<%# Container.DataItem(5)%>
runat="server"/></td>
</tr>
<tr>
<td><asp:label id="litLabel" Runat="Server" Text="labelti"
Visible="false"/></td>
</tr>
</itemtemplate>

when u click on the linkbutton, the label(eventually it will be a
placeholder with more database info in another repeater) will become
visible with detailed info bout the job.

the first Container.DataItem(0) has an ID number that I need to extract
and send to the stored procedure. how can i extract that dataItem. ive
been able to loop throw the items in the repeater item and extract the
entire row. i tried to convert that info to a DataBoundLiteralControl
and pull the text from it. but when i tried to use string functions to
pull the ID number or even get a length of string i could consistently
get what i need. i figured out that row is coded with <html> table and
row tags. thus, im back to trying to get the data from the first
container.dataitem. so, to make a long request even longer, what object
or class do i use to pull individual dataitems from an item. i looked at
the dataitem property from repeateritem class, but i cant get it to
work. again, thx for the help.
 
yes, thx for the offer. martin helped me out. it's great to see the
asp.net community is helpful and sticks together.

ric
 
Back
Top