Discussion Locked

How do I assign values of text box in Dg

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I am using a recordset object, and I have saved the information using text boxes and command buttons. How do I populate the values of the text boxes in the DataGrid?. Thanks a lot in advance if however could help me in this.

5 replies

by satheesh

hi
This is very simple , u can use Rows,Row,Cols,Col property.

1.Get the row of datagrid which to be updated.(temp_Row=datagrid1.row)

2.Get the col of datagrid Which to be update
(temp_Col=datagrid1.col)

3.Set the value
datagrid.row=temp_row
datagrid.col=tempcol
datagrid1.text=textbox1.text

It will be reflected in the Datagrid.

If u any query send me..

cool
With luv
S.Satheesh

by sl-campbell

If you are using a recordset and have saved the input in the text boxes to the fields in the recordset, then you could assign the datasource of the datagrid to the record set. The datagrid will then be populated with all the records from the recordset object. If you do this initially, (assign the datasource to the recordset), then after updating the recordset with the users input the datagrid will also be updated.
If you only want one record to be populated, you could create a second recordset object like the first and set the criteria to the record from the first recordset and then set this recordset to the datagrid's datasource. If you do not want the user to be able to update/add records in the datagrid, but only via the textboxes, you can set the grid's properties to prevent this.
Or you could follow the first answers directions - however, you will need to do this after every update, and if it is only one or a few records for show and tell only, then it may be better to use aListView or ListBox control.

This discussion is closed to new replies.