How do I list item in a templatecolumn?

J

jm

I have a pushbutton in templatecolumn in a DataGrid. I can iterate
through some of the rows in the datagrid with:

sub alert_inactive(sender As Object, e As DataGridCommandEventArgs)
dim item as datagriditem

For Each item In sender.Items
response.write("<br>The answer is: <BR>" & item.Cells(1).Text & " " &
item.Cells(2).Text & " " & item.Cells(3).Text)
Next item
end sub

However, in the DataGrid there is this:

<asp:TemplateColumn HeaderText="Completed"
ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:button id="butCompleted" causesvalidation="false"
text="Completed?" commandname="Delete" Runat="server" />
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Completed"
ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:button id="butChecked" commandname="Delete"
causesvalidation="false" text="Checked?" Runat="server" />
</ItemTemplate>
</asp:TemplateColumn>

I cannot figure out how to get the ID of these two buttons in this
function.

Thank for any help.
 

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

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top