How do I list item in a templatecolumn?

Discussion in 'ASP .Net Datagrid Control' started by jm, Nov 3, 2003.

  1. jm

    jm Guest

    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.
     
    jm, Nov 3, 2003
    #1
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    4
    Views:
    636
    Mike Meyer
    Dec 31, 2005
  2. Replies:
    5
    Views:
    637
  3. Replies:
    0
    Views:
    416
  4. John Dalberg
    Replies:
    0
    Views:
    674
    John Dalberg
    Jan 19, 2007
  5. QUASAR
    Replies:
    6
    Views:
    656
    QUASAR
    Jan 17, 2004
  6. M. Craig

    How to set background color of List item in dropdown list

    M. Craig, Nov 12, 2003, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    457
    M. Craig
    Nov 12, 2003
  7. M. Craig
    Replies:
    1
    Views:
    949
    Victor Garcia Aprea [MVP]
    Jan 9, 2004
  8. Hiten
    Replies:
    1
    Views:
    965
    Vidar Petursson
    May 26, 2004
Loading...