textboxes to datagrid
-
I have 5 textboxes. I also have a datagrid. the datagrid has 5 columns.ItemID,CheckNo,Payee,Amount,Date. I need textbox1 to go to ItemID(column1,row1) I need textbox2 to go to CheckNo.(column2,row1) Textbox3 to payee(column3,row1) textbox4 to amount(column4,row1) textbox5 to date(column5,row1) I need these to do so on a button click and I already know that the code must be placed in the Private Sub Button1_Click part. How do I get these textboxes to do so?
-
I have 5 textboxes. I also have a datagrid. the datagrid has 5 columns.ItemID,CheckNo,Payee,Amount,Date. I need textbox1 to go to ItemID(column1,row1) I need textbox2 to go to CheckNo.(column2,row1) Textbox3 to payee(column3,row1) textbox4 to amount(column4,row1) textbox5 to date(column5,row1) I need these to do so on a button click and I already know that the code must be placed in the Private Sub Button1_Click part. How do I get these textboxes to do so?
Hi, I assume your Grid'd Datasource is dtGrid (Datatable) in that case in Button_Click Event u can Create a New Datarow of dtGrid dim drNew as Datarow drNew = drGrid.NewRow than just pass on the Values of TextBoxes........as drNew.Item("ItemID") = txtItem.text...... .............. after that just add this Row to ur Table as dtGrid.Rows.add(drNew) dgGrid.Refresh...... I hope this is what u want..... Regards, Ritesh
-
Hi, I assume your Grid'd Datasource is dtGrid (Datatable) in that case in Button_Click Event u can Create a New Datarow of dtGrid dim drNew as Datarow drNew = drGrid.NewRow than just pass on the Values of TextBoxes........as drNew.Item("ItemID") = txtItem.text...... .............. after that just add this Row to ur Table as dtGrid.Rows.add(drNew) dgGrid.Refresh...... I hope this is what u want..... Regards, Ritesh
Hey It Seems to be ok but the part that says drNew = drGrid.NewRow it says NewRow is not declared. am I supposed to replace this with something.