PDA

View Full Version : Need the array ID field, but don't want to show it


ericb1
11-28-2005, 10:36 PM
any help is greatly appreciated, I use ASP to get an array of data from my database, then display it in a datagrid.

I have corresponding fields under the datagrid that show the data to be edited, etc., then I have a "SAVE" button that saves it back to the db via ASP.

My problem is that I need the ID of the record so when I post the changes back to my db, I can say "Update table where ID=" But I don't want to show the ID column in the datagrid, it just takes up space and it means nothing to the users.

Is there a way to mark a datagrid column not visible, or another way to get the ID field into my data, so I can refer back to it?

Thanks!

jaspers_cool
02-07-2006, 03:01 PM
depart_array = new Array();
for (i=0; i<int(this.count); i++) {
depart_array.push({department:this["department"+(i+1)], unique:this["id"+(i+1)]});
}
department_dg.columnNames = ["Department"];
department_dg.dataProvider = depart_array;


This will only show Department and not the unique value.
hope it helps