Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FindControl

Status
Not open for further replies.

feemi

Programmer
Feb 3, 2001
17
US
I have a datagrid that contains a template column. In this column I have two controls: The first control is an input field, the second is an asp:button control. The user can enter a value in the input field and select the button (Save) control. When the save button is selected, the Handle_Grid_Event fires as it should, but how do I get the value of this input control within the Handle_Grid_Event?
 
You could do this:

- Keep the template column, but get rid of the button
- Add a button column to the datagrid (Select)
- Change the select button's text to "Save"
- In the DataGrid's SelectCommand function in your code
behind, do something like:

Dim textvalue as string
textvalue = e.cells(1).controls(1).Value

or you may have to do
Dim text as new Textbox
text = e.cells(1).controls(1)

and get the text value that way (don't have vs.net here at work, so can't remember the exact syntax. Something along the lines of above anyway)

hth

D'Arcy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top