Locked Setting cell value in datagridview

  • Tuesday, March 20, 2012 2:06 PM
     
     

    All:

    Very new vb.net.  I am building a form with text boxes on top and a data grid view on the bottom (parent child).  I am using the a sequence (or line number) as the unique identifier for each child row of the parent.  My intent was to use either a trigger or a stored procedure or a select statement back to the database to set the next line number/sequence however I cannot find anyway to set the cell value using the stored procedure or select statement and the trigger seems to just be ignored.

    Can anyone tell me how to set the value of the line/sequence cell on a new row as soon as the user clicks in the row to add a new row?

    Thanks,

    G

All Replies

  • Tuesday, March 20, 2012 6:11 PM
     
     Answered

    Hi GiberD,

    try below syntax to set cell value in datagridview

    Me.MyGridView.CurrentRow.Cells("DataGridViewTextBoxColumn8").Value = 20

    Regards

    Alisha

    • Marked As Answer by GiberD Friday, March 23, 2012 3:34 PM
    •  
  • Friday, March 23, 2012 3:36 PM
     
     

    Alisha:

    Thanks, the easy answers are sometimes the hardest to find :)  This worked just as I wanted.

    Regards,

    G


    G