Assign Values to Hidden Columns in datagrid

I have a datagrid being displayed in a tab control.  Not all columns need displayed so I have no shown them.  When entering data, there are key fields that are assigned from a "header" part of the form.  The columns are:


The user enters these values elsewhere.  When the user enters rows in the datagrid and then saves, I need each row in the grid to have the columns Job Number, Slip Number, and SWO Number to be assigned the values in the textboxes txt_Slip_Number, txt_Job_Number and txt_SWO_Number?  

Please advise.  Thanks!
Who is Participating?
CodeCruiserConnect With a Mentor Commented:
You can handle the DataTable.TableNewRow event and add the values to the columns(this assuming that you are using a datatable/dataset as the datasource of grid)
Just a clairfication datagrid or gridview?

I know you already mentioned but some people say datagrid when actually they are refering is datagridview. Datagrid and datagridview is different.
tobin46Author Commented:
@PagodNaUtak - sorry datagridview
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

tobin46Author Commented:
Maybe you could show me a sample of code that would add records to a db from a datagridview.
Columns 1, 2, 3, 4 - but Column 1 is hidden and the key and will be equal to a value in textbox_ID.
Did you try my suggestion?
tobin46Author Commented:
Just did.  Worked.  Thanks.
tobin46Author Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.