Skip to content

How to update datagrid using text boxes

Maria

Asked Dec 8, 2008, 12:07 PM EST1 answer
Share
LinkedInX
I am using Visual Studio and I am trying to update my datagrid using the info from text boxes rather than using the binding navigator to directly input the information.  I was hoping that I can fill in the fields with the info and click a button to update my datagrid.  Is this possible?  If so how?

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • Bechir Bejaoui
    +1
    It isn't a practical way to deal with datagridview but never the less if you want to assign data from textboxes to datagridviewcellsprogrammatically you can  do this

    datagridview[columnIndex,rowindex].Value = textBox.Text;

    example:
    textBox.Text = "Maria";
    datagridview[0,0].Value = textBox.Text;

    this couple of lines will put Maria in the first datagridviewcell
     
    +1