473,604 Members | 2,483 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(Obje ct sender, DataGridCommand EventArgs e){

TextBox StartTime = (TextBox)e.Item .Cells[2].FindControl("U pdateStartTime" );
Response.Write( "Start Time = "+StartTime.Tex t);
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 1471

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

Similar topics

4
309
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 values. e.g if i want to add a value to the second row and second column do i write coordinates such as.. (2,2)
1
2125
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 BUTTON LIST SELECTION entered by the user in the web form into tha database. for eg. for inserting values from a text box into the database we write code :: sqlCommand1.Parameters.Value =TextBox1.Text & for inserting integer values we write::...
0
970
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, and I want to pass this information back into the datagrid into a textbox (dgFirstName and dgLastName) on the row that they clicked the button on. How can you reference that particular textbox on the row? The code below almost does what I...
0
984
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 user may click on the space and type the information, which can later be printed. Is it possible to plug in these values from within .net? I have a feeling it can't be done but I wanted to check with you guys first. I don't want to save anything;...
4
1357
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 like to take the values and enter them into a String Variable, but can't find a good way to do this with more than 1 value.. Help!! Thanks, Shawn
1
1537
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 follows: DataGrid1.TableStyles(0).GridColumnStyles(0).Width = 140 DataGrid1.TableStyles(0).GridColumnStyles(1).Width = 125 DataGrid1.TableStyles(0).GridColumnStyles(0).Alignment = 0 DataGrid1.TableStyles(0).GridColumnStyles(1).Alignment = 1
1
1794
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
1556
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 using wampserver.Please help me for this prob.
1
1692
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(); cnn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\\medical.mdb"; cnn.Open(); string str = "insert into...
0
7929
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8419
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8065
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6739
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5882
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5441
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3907
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3955
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2434
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.