Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8204883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T08:02:12+00:00 2026-06-07T08:02:12+00:00

How to add a row in datagridview in winform application . Scenario is: I’ve

  • 0

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 ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T08:02:14+00:00Added an answer on June 7, 2026 at 8:02 am

    Just try like this –

    dataGridView1.Rows.Add(<col1 value>,<col2 value>,...)
    

    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-

    myMainApplication.dgvBooksDetails.Rows.Add(objBook.ID, objBook.Title, objBook.Author, 
                objBook.Genre, objBook.Price, objBook.PublishDate, objBook.Description);
    

    EDIT

    In Sub Form, store instance of Main Form –

    public MainForm _mainForm;
    

    In Main Form :

    SubForm frm = new SubForm();
    frm.MainForm = this;
    frm.Show();
    

    Then to fill up datagrid, do like this –

    _mainForm.dgvBookDetails.Rows.Add(.....
    

    Hope it helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a winform datagridview: DataTable table = new DataTable(); table.Columns.Add(Check, typeof(bool)); table.Columns.Add(User, typeof(string));
In Visual Studio 2008 add a new DataGridView to a form Edit Columns Add
I am trying to update a datagridview in window form application. Here is my
I had only one function to Add another row to the table id=tblOtherParties and
I have a form created which an unbound datagridview that has three columns. Position,
I work with windows forms and on the form I have a DataGridView. This
I've used the following to add a table to a DataGridView on a WinForm:
I work with a WinForms app. I want to add one row to a
When I fill a DataGridView row by row (calling it's add function), the top
I want to take each row in a datagridview and add it to a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.