Keeping track of controls in a DataGrid

Discussion in 'ASP .Net' started by Manuel, Dec 10, 2004.

  1. Manuel

    Manuel Guest

    I have the following DataGrid:

    <asp:datagrid id="grdPackages" runat="server" AutoGenerateColumns="False"
    AllowSorting="True">
    <Columns>
    <asp:BoundColumn DataField="ShipDate" SortExpression="ShipDate"
    HeaderText="Ship Date"></asp:BoundColumn>
    <asp:TemplateColumn HeaderText="Confirm">
    <ItemTemplate>
    <asp:Button id="btnConfirm" runat="server" Text="Confirm"></asp:Button>
    </ItemTemplate>
    </asp:TemplateColumn>
    </Columns>
    </asp:datagrid>


    How do I add functionality to the btnConfirm? I want to calculate another
    value based on the ShipDate [and store it in a database], how do I get the
    date of the row?
     
    Manuel, Dec 10, 2004
    #1
    1. Advertising

  2. "Manuel" <> wrote in message
    news:...
    >I have the following DataGrid:
    >
    > <asp:datagrid id="grdPackages" runat="server" AutoGenerateColumns="False"
    > AllowSorting="True">
    > <Columns>
    > <asp:BoundColumn DataField="ShipDate" SortExpression="ShipDate"
    > HeaderText="Ship Date"></asp:BoundColumn>
    > <asp:TemplateColumn HeaderText="Confirm">
    > <ItemTemplate>
    > <asp:Button id="btnConfirm" runat="server"
    > Text="Confirm"></asp:Button>
    > </ItemTemplate>
    > </asp:TemplateColumn>
    > </Columns>
    > </asp:datagrid>
    >
    >
    > How do I add functionality to the btnConfirm? I want to calculate another
    > value based on the ShipDate [and store it in a database], how do I get the
    > date of the row?


    Use the ItemDataBound event of the DataGrid.

    John Saunders
     
    John Saunders, Dec 11, 2004
    #2
    1. Advertising

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. John
    Replies:
    0
    Views:
    372
  2. Utter Newbie
    Replies:
    0
    Views:
    483
    Utter Newbie
    Jul 28, 2003
  3. =?Utf-8?B?dHBlcnJp?=
    Replies:
    4
    Views:
    2,040
    =?Utf-8?B?Rng=?=
    Jul 12, 2005
  4. xzzy

    keeping track of threads

    xzzy, Oct 6, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    473
  5. Anders Steinlein

    Keeping track of online users

    Anders Steinlein, Apr 20, 2004, in forum: Java
    Replies:
    0
    Views:
    380
    Anders Steinlein
    Apr 20, 2004
Loading...

Share This Page