Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_professional thread: Retrieving TextBox values from a DataGrid Footer


Message #1 by "Ed Courtenay" <replace-this-with-my-first-name@e...> on Wed, 24 Apr 2002 18:09:55 +0100
You're a lifesaver! It worked perfectly - many thanks.

----- Original Message -----
From: "Paul Czywczynski" <paul@p...>
To: "ASPX_Professional" <aspx_professional@p...>
Sent: Wednesday, April 24, 2002 6:19 PM
Subject: [aspx_professional] RE: Retrieving TextBox values from a DataGrid
Footer


> Here is what I use for a "Goto Page Number" textbox in my datagrid
> footer:
>
>
> protected void btnGoToPage_Click(object sender, System.EventArgs e)
> {
>     TextBox txtGotoPageNumber 
> (TextBox)(MyDataGrid.Controls[0].Controls[MyDataGrid.Controls[0].Control
> s.Count - 1]).FindControl("txtGotoPageNumber");
>     try
>     {
>         MyDataGrid.CurrentPageIndex 
> (Convert.ToInt32(txtGotoPageNumber.Text) - 1);
>         MyDataGrid_DataBind(true);
>     }
>     catch
>     {
>     }
> }
>
>
> -Paul
>
>
> -----Original Message-----
> From: Ed Courtenay
> [mailto:replace-this-with-my-first-name@e...]
> Sent: Wednesday, April 24, 2002 12:10 PM
> To: ASPX_Professional
> Subject: [aspx_professional] Retrieving TextBox values from a DataGrid
> Footer
>
>
> Hi all,
>
> Forgive me if this question's been asked before, but I can't figure out
> the answer to this one.
>
> First off, a bit of background. I'm using the DataGrid to display a
> simple list of users from a DataSet, which works really well. The Edit
> and Update mechanisms that the DataGrid give you are really powerful
> stuff.
>
> Anyway, I decided to use the Footer area of the DataGrid to allow input
> of a new user, so I added a couple of TextBox controls to the Footer
> areas of the relevant column, and added a LinkButton to the Footer area
> of the Edit/Update column.
>
> In the DataBind event for the DataGrid, I wire up the Click event for
> the LinkButton, which works perfectly, however no matter how hard I try,
> I simply cannot seem to get access to the TextBox controls, and more
> importantly, to the values submitted in them.
>
> Has anyone got any ideas on how I can overcome this?
>
> Cheers
>
> Ed Courtenay
>
>
>
>
>


  Return to Index