Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: Datagrid - ItemTemplate ASP:Textbox ID=txtComment


Message #1 by mhtsoftware@h... on Tue, 4 Dec 2001 22:19:28
I am currently binding a dataset to a grid.  In the ItemTemplate 

(ASP:Textbox) - I want to load in a value into the textbox on the grid.  I 

can retrieve the value by looking at:  

Grid.Items(x).findcontrol("txtcomment"), but I can not seem to find a way 

to set the value of the textbox withing the Grid!



Help

Greg Bloom
Message #2 by Tim Heuer <TimH@i...> on Tue, 4 Dec 2001 16:03:16 -0700
Greg,



You have part of the step...you need to cast an object and then access it

directly:



C#:

TextBox mybox = (TextBox) Grid.Items(x).FindControl("txtcomment");

mybox.Text = "My new text I want in the box goes here.";



-----Original Message-----

From: mhtsoftware@h... [mailto:mhtsoftware@h...] 

Sent: Tuesday, December 04, 2001 3:19 PM

To: ASP+

Subject: [aspx] Datagrid - ItemTemplate ASP:Textbox ID=txtComment





I am currently binding a dataset to a grid.  In the ItemTemplate 

(ASP:Textbox) - I want to load in a value into the textbox on the grid.  I 

can retrieve the value by looking at:  

Grid.Items(x).findcontrol("txtcomment"), but I can not seem to find a way 

to set the value of the textbox withing the Grid!



Help

Greg Bloom

---

VBug Winter Conference 2001 



Open Forum:  Dan Appleman will be hosting an open 

forum at The .NET Developer's Conference on 

29th November 2001.  The session will give 

developers the chance to discuss and question 

Dan on his experience with the .NET environment.  

Dan has been programming Visual Basic since the 

alpha version 1.0.  And with over 10 years 

Visual Basic experience is well qualified to 

help you on your road to being a .NET Guru.



http://www.vbug.co.uk/redirect.asp?url=39&id=17



---

You are currently subscribed to 

aspx as: timh@i...


$subst('Email.Unsub')


  Return to Index