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 903443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:52:45+00:00 2026-05-15T15:52:45+00:00

I have a WIndows Forms Application. I needed a DataGridView so i added one.

  • 0

I have a WIndows Forms Application. I needed a DataGridView so i added one. I asume that the user adds some rows and press a save button.

At this moment i want to save all rows in the grid. I iterate trough all rows like that

foreach (DataGridViewRow item in dataGridView.Rows)
            {
            }

Now the problem. I have tested it with one row in the grid. The first row (which i typed in) comes correctly. then comes a nother row wich i didnt accpected. All values in that row have the value 1 for int and null for string. and then comes a row this just null for every column.

EDIT:
May i explain what i wanted to do. I have objects with 4 propreties. I have list of this objects. And i want that the user edits and manuplates that list and the obejcts inside it,

EDIT2:
My problem is not to get the Data. My problem is that is get Data which not exists. I have tried it with 4 rows now. So i filed in 4 rows in the grid.

my input was

1 2 a 1  
12 3 b 3
12 4 c 4 
13 5 d 5

output is

1 2 a 1  
1 1 null 1 (why the heck is that one here :( )
12 3 b 3
12 4 c 4 
13 5 d 5 
null null null null (this row i could live with cause i know where it comes from)
  • 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-05-15T15:52:46+00:00Added an answer on May 15, 2026 at 3:52 pm

    make for your DataTable dt, dt.AcceptChanges();
    and start loop in foreach(DataRow dr in dt.Rows)

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

Sidebar

Ask A Question

Stats

  • Questions 492k
  • Answers 492k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer <iframe name="myIframe" width="800" height="600" src="page.htm"> </iframe> and then if you… May 16, 2026 at 10:28 am
  • Editorial Team
    Editorial Team added an answer I'd say Gregg Pollack's Scaling Rails series is by far… May 16, 2026 at 10:28 am
  • Editorial Team
    Editorial Team added an answer You can already make it slightly nicer than it is… May 16, 2026 at 10:28 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have a Windows.Forms based .NET desktop application that stores privileged information in a
I have a CheckedListBox in my Windows forms application, but items can be added
Scenario I have a windows forms application. I want to use two different WCF
I have written a C# Windows Forms application to merge the files and folders
I have multiple business entities in VB.NET Windows Forms application. Right now they are
I have a Windows Forms application where I need to make all fonts of
I have a user control with a textbox in a win forms application. I
I have a strange application in that for development and testing I need a
I have 15 BackgroundWorers that are running all the time, each one of them
I have a WinForms application. That application have a rich functionality. It can create

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.