Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Adding data from a text box to a datagrid

HI,

From the tool box I dragged and dropped three controls a datagrid, a text box and a button. Button and text box are outside the datagrid. If some thing is typed in the text box and then button (say Add button) is clicked. The data from the textbox must be added to the field in the datagrid. There is no table attached to the grid (i.e. no data source).

So if I type say 1006 1st and then 1008 and so on in the text box and after each entry press Add button, it should add that value to the datagrid row (i.e to new row each time). Datagrid has only one field/column.

Can some one please refer to a link were this kind of problem is addressed or can give me a detail idea of how it can be achieved.

Thanks in advance
[757 byte] By [srinivasc_it] at [2007-11-11 9:58:31]
# 1 Re: Adding data from a text box to a datagrid
How do you intend to use the data after the user fills the grid? If you only want to display it on the page, a DataGrid is overkill; you may simply use JavaScript to fill an HTML table on the client. If, on the other hand, you plan to do something with the data on the server, you should bind the DataGrid to a data source. You may then use that data source to retrieve the values when the user submits the page.
Phil Weber at 2007-11-11 23:12:19 >