Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataGrid

Status
Not open for further replies.

dpanattoni

IS-IT--Management
Jan 29, 2002
76
US
I have a datagrid that allows the user to Add/Modify/Delete child records of a parent. The database format of the child record is:

Parent_Key
Item_Number
Child_Field#1
...
Child_Field#5

The fields that are displayed in the datagrid are Child_Fields#1 - #5.

When it comes time to do the update, I need to construct the SQL statement so that the appropriate child record is updated in the database. ie: UPDATE Child_Record Set Child_Field#1 = 'XXXX' where Parent_Key = 'xxxx' and Item_number = '2'.

My question is this. What is the best way to retrieve Item_number? I have tried putting it in as an invisible field, but I haven't found how to access it during the update. I also tried putting it into the grid as visible, but no updating allowed. This seems closer, but I don't know how to extract it's contents at update time.

Thanks for the help.
 
I'd suggest making use of the 'DataGridTableStyle' against a dataGrid and then making use of the 'GridColumnStyle's within that.
This will allow you to set properties as required against the columns in the grid style as required - that is you are able to set their width's, etc - and furthermore whether or not they are displayed or not (or just set to ReadOnly).
The column is still there and as such can be made use of by referencing it.
Hope that this puts us in the right direction with things.
Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top