how to add a new row to datagridview + bound text boxes et
I have a datagridview(too small to put all the column values) so I used some text boxes in a form below to display the entire detail for any selected row. The textboxes are bound to the same databindingsource as the datagridview..The selected row in datagrid populates values in the textboxes.
I want some mechanism so that when a user wants to add a row, they can put their values in the textboxes and hit add button which puts the new row in the datagridview. Is this possible?
Thanks..
You can use an ADO.net object with a submit button that binds with the same recordset.
So when the user submits a record through the associated text boxes, it grdview.databinds()
Problem solved.
Adamus
Paul,
The bigger problem is in the UI aspect. The textboxes are bound to the same databindingsource as the datagridview. For the user to be able to add a new item, I am not able to provide them with textboxes which are completely cleared out.
The textboxes always display the detail from the current selected item in the datagridview. If I programatically, try to do this by selecting a new row in the datagridview, then having the user to edit that empty row(the textboxes still pick up the values from the last row in the datagridview..).
Bottom line, I can't get empty non bound textboxes so that user can use it as a regular data entry form.
Thanks
Nik