How to add a row in datagridview in winform application.
Scenario is:
- I’ve one grid on windows form.
- Grid’s columns are pre-definded. (Here, I mean column index, name ,
header text and order is not changeable at runtime.) - I need to add new row in that grid.
Anyone, help me in this regard. How can I do this task ?
Just try like this –
The parameters will be values you intended for your each columns.
EDIT :
Taking your code from other comments, you can simply use it like this-
EDIT
In Sub Form, store instance of Main Form –
In Main Form :
Then to fill up datagrid, do like this –
Hope it helps!