I have a datagrid with checkboxes for each row.<BR><BR>The user is able to select the ones he wants, then hit a "Save" button, which then loops through them all and insert the checked ones into a DB.<BR><BR>At the moment i am using the following code to do it, which is assigning the ID of the record to the "text" value of the checkbox, then i am using this to insert the correct records into the DB.<BR><BR>My question is: - is it possible to do this using the Datakeyfield value, which is also set in the dgrid to record ID for each row - as my solution is not ideal, as the user can see the ID&#039;s assigned to the checkbox text if they highlight the grid/page.<BR><BR>Any pointer/code examples would be much appreciated....<BR><BR>Cheers<BR><BR><BR>&#039;///////////////////////////////////////////////////////////////////////////////////////<BR>Sub InsertAssigned()<BR>Dim GridItem As System.Web.UI.WebControls.DataGridItem<BR>Dim chkBox as System.Web.UI.WebControls.CheckBox<BR>Dim SQLUpdate as String<BR><BR>For Each GridItem In dgBrowser.Items<BR> chkBox = GridItem.FindControl("SELECTED_ITEMS")<BR> If chkBox.Checked Then<BR>SQLUpdate = "INSERT INTO dbo.COURSE_GROUPS_LIST ( COURSE_GROUP_ID, COURSE_ROOT_ID, "<BR>SQLUpdate = SQLUpdate & "ADDED_BY_USER_ID, LICENSE_ID ) "<BR>SQLUpdate = SQLUpdate & "VALUES "<BR>SQLUpdate = SQLUpdate & "( " & "" & SelectedID & ", " <BR>SQLUpdate = SQLUpdate & "&#039;" & System.Convert.ToInt32(chkBox.Text) & "&#039;, "<BR>SQLUpdate = SQLUpdate & "&#039;" & Session("USER_ID") & "&#039;, "<BR>SQLUpdate = SQLUpdate & "&#039;" & Session("LICENSE_ID") & "&#039; ) "<BR><BR>MiscFunctions.SQLNonQuery( SQLUpdate )<BR>End If<BR>Next<BR>End Sub<BR>