How to add values from textboxes into a griddataboundgrid

Hi!
i would like to now how to insert values from textboxes into a row of a GDBG.

I tried with this but the values are not inserted:

Private Sub btnAddProduct_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddProduct.Click

Try
Me.GridDataBoundGridPedido.Item(1, 1).CellValue = 12

'Me.GridDataBoundGridPedido.Item(1, 1).CellValue = Me.txtCodProd.Text
'GridDataBoundGridPedido.Item(1, 2).CellValue = Me.txtDescProd.Text
'GridDataBoundGridPedido.Item(1, 3).CellValue = Me.lblPrecProd.Text
'GridDataBoundGridPedido.Item(1, 4).CellValue = Me.txtCantProd.Text
'GridDataBoundGridPedido.Item(1, 5).CellValue = 1224
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try


End Sub
If someone could give me the solution, i would appreciate a lot!
Thank!

1 Reply

JJ Jisha Joy Syncfusion Team October 26, 2009 09:33 AM UTC

Hi Elias,

You could use the following code to set the values to the cells of GridDataBoundGrid.


this.gridDataBoundGrid1.Model[2, 1].Text = this.textBox1.Text;
this.gridDataBoundGrid1.Model[2, 2].Text = this.textBox2.Text;
this.gridDataBoundGrid1.Model[2, 3].Text = this.textBox3.Text;


Please let me know if you have any questions.

Regards,
Jisha

Loader.
Up arrow icon