In DataGridView, how can i input data then add row

in order to add new row you have to define column in your grid then just add row like this
for example i have to textboxes txtName , txtFatherName and a grid with two columns , name and father name , a button , i want to add new row in my grid by clicking that button. use this code at the click event of the button

datagridview1.rows.add(txtName.text,txtFatherName.text)

this will add row to your grid.

Regards

thanks a lot! Problem solved!

Best Regards!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.