473,322 Members | 1,421 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,322 software developers and data experts.

add textbox and command button on the datagrid

my idea is want to add textbox on the datagrid. the data of the textbox was extract from DB. use can change the value on the textbox anytime. after the change, user just click the button on the datagrid to save to DB. Is it possible to do that??? and how to ??
Million Thanks..
Nov 18 '05 #1
1 1579
Hi Grey,
my idea is want to add textbox on the datagrid. the data of the textbox was extract from DB.
you can do this by creating template comulns in the datagrid. Add textboxes to the template column and set the text property of this textbox to DataBinder.Eval("myDatasource" , FieldName) , thus you will be able to populate the values from the datasource to the textbox, when you call this code in the page load method of the page.

Datagrid1.datasource = myDatasource;
Datagrid1.DataBind();
user just click the button on the datagrid to save to DB. Is it possible to do that??? and how to ??

now to update the values you need to write the code in the DataGrid1's ItemCommand. write the appropriate logic to retrieve all the items in the datagrid and call the logic to update the values to your datasource.

HTH
Cheers
Ashish M Bhonkiya

"Grey" <er*****@i-cable.com> wrote in message news:Oh**************@TK2MSFTNGP10.phx.gbl...
my idea is want to add textbox on the datagrid. the data of the textbox was extract from DB. use can change the value on the textbox anytime. after the change, user just click the button on the datagrid to save to DB. Is it possible to do that??? and how to ??

Million Thanks..

Nov 18 '05 #2

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

Similar topics

2
by: Jeroen van vliet | last post by:
Hello How can i run a query from a mdb database and show it in a datagrid control when i put in a letter in a textbox? for instance. when i type the letter "A" in the textbox i want to run a...
0
by: Andrea Trevisan | last post by:
That's a revival of a known thing I suppose.I hope it's useful. My problem was: I want to have a DataGrid with two Template columns: first with TextBox,second with Button.I want to fire an event...
0
by: jason | last post by:
Hello everyone. I am trying to write some custom command events into a DataGrid. The command that is currently giving me trouble is an "Add" custom command in the footer of a template column. ...
3
by: rn5a | last post by:
A DataGrid has a BoundColumn, an EditCommandColumn & a few TemplateColumns. When the text in the EditCommandColumn within any of the DataGridItems is clicked, the corresponding BoundColumn changes...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.