Asp.net Insert into datagrid textbox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,


I have a datagrid containing template columns which allow editing of the
values contained in the datagrid through the use of text boxes.

One of the fields in the datagrid displays the time and date.

When a row has been selected for editing I want to be able to click a button
in the datagrid and update one of the text boxes with the current time and
date.

All the code for editing rows and getting the current time and date when you
click a button works fine. My only problem is inserting the current date and
time into the text box within the selected row of the datagrid.

I can get the value of the text box OUT of the datagrid by calling the
function below from the datagrid:

void UpdateTime(Object sender, DataGridCommandEventArgs e){

TextBox StartTime = (TextBox)e.Item.Cells[2].FindControl("UpdateStartTime");
Response.Write("Start Time = "+StartTime.Text);
Response.Flush();

}

But I just can't put a value INTO the text box in the datagrid.

I've tried lots of variations of commands, but none of them seem to work!

Any ideas?

Thanks in advance
 
Back
Top