Combo box in data grid control

Debbie Coates replied to Madhava Rao Bitra at 04-Jan-08 07:12

I have adapted and used the example given to successfully place a combo box in my datagrid

however, I have One problem

when I later call a command to update the underlying recordset of the datagrid, I get an error because I am trying to update the many side of a one to many table relationship.

In actual face, i want to display this record on my datagrid, but I dont actually want to update that particular field

this code sets my datagird

If cboFundSource.Visible = True Then
      grd_FundAllocation.Columns(1).Text = cboFundSource.ItemData(cboFundSource.ListIndex)
      grd_FundAllocation.Columns(2).Text = cboFundSource.Text
      grd_FundAllocation.Columns(3).Text = gURN
End If

and when i update it later i use

        With rs
        .MoveFirst
        .UpdateBatch
        End With

as i said, this fails becasue i am trying to update col(2), i actually only want to update columns 1 and 3

I would apprecieate any help in solving this

 

regards

 

 

 


Click here to sign in and reply. You could earn money via our $500 contest just for being helpful.
  Article Discussion: To place a combo box in the data grid control - Madhava Rao Bitra  13-Oct-07 12:17 12:17:16 AM
      Combo box in data grid control - Debbie Coates  04-Jan-08 07:12 7:12:10 AM
View Posts