Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Building Controls (http://www.velocityreviews.com/forums/f59-asp-net-building-controls.html)
-   -   ASP.NET 2.0 - set Textbox1 to a Value from GridView1 using Button1 (http://www.velocityreviews.com/forums/t757903-asp-net-2-0-set-textbox1-to-a-value-from-gridview1-using-button1.html)

Jado 08-24-2005 10:46 AM

ASP.NET 2.0 - set Textbox1 to a Value from GridView1 using Button1
 
Hi

I'm looking at asp.net for the first time after downloading ASP.NET 2.0 VWD
Beta2. I got off to a good start but i've really been stuggling to answer
this myself.

in default.aspx i have GridView1 using sqlDataSource1 which contains a field
called "au_lname". This field is not a primaryKey.

below the GridView1 control is TextBox1 and Button1

in default.aspx.vb i want Button1_OnClick to set the value of TextBox1 to
the value of "au_lname" in the GridView1 control or sqlDataSource1 Control
(which ever is possible or the most appropiate).

unforfunately i don't have exactly what i've been trying out to hand, but
i've tried something like this..

Sub Button1_OnClick(..etc..)
TextBox1.Text = GridView1.TemplateControl("au_lname").ToString
or
TextBox1.Text = GridView1.SelectedRow.DataItem("au_lname").ToStrin g
End Sub

If someone could provide a solution, that would be great. If i'm way off
the mark, could you please include some comments to put me on the right
track.

Thanks

Jado




All times are GMT. The time now is 12:30 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.