473,382 Members | 1,749 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Inserting Values into a Text Box within a Datagrid

I have a databound 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

--
Message posted via http://www.dotnetmonster.com
Nov 16 '05 #1
0 1460

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Tonya | last post by:
Hi All, I wanted to ask how i can add values from textboxes etc into a specific coloumn and row of a datagrid. I.e does the datagrid have coordinates that i can refernce when i want to add...
1
by: pmud | last post by:
I have an ASP.NET web application using C# code. I am trying to insert values from a web form into an SQL database. I am using SQL COMMAND object for this. I need to know HOW TO INSERT THE RADIO...
0
by: Brian Conway | last post by:
Is there a way to take information gathered outside of the datagrid (ie, Last Name First Name). I have a button click event on a webform that goes to an LDAP service and retrives this information,...
0
by: VMI | last post by:
I have a PDF document that, when opened with Acrobat Reader, values can be typed into it. For example, if the PDF document is a work application and it asks for First and Last Name information, the...
4
by: Shawn | last post by:
This must be easy, but I can't find a way to do it. I have a datagrid displaying Rows from a Datatable. I want to take the values in the Row and ultimately use them in a SQL Where string. I would...
1
by: cr113 | last post by:
How do I format text in datagrid column? I have a column of currency values and I want them all to display with 2 decimal points (XXX.XX). I figured out how to set the width and alignment as...
1
by: ram achar | last post by:
please send me C# code for inserting values into database sql server2005 *** Sent via Developersdex http://www.developersdex.com ***
9
by: Bunty | last post by:
I am not beginer of this language. I've worked on this language for 2 or 3 months.But now i have a problem to inserting values in the database.It gives me error that DATABASE NOT SELECTED. I am...
1
by: arvindmishra | last post by:
i m inserting values in access database it displays message value is inserted but value is not ptresent in database. I m using following code OleDbConnection cnn = new OleDbConnection(); ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.