Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 702
  • Last Modified:

DataGridView with unbound field

I have a DataGridView on a form.  I would like this DataGridView to be populated with 4 Fields.
1. Posted
2. Invoice #
3. Invoice Date
4. Total

The last three fields invoice #, Invoice Date and Total are all stored in the invoices Table but my first field which I added is not stored anywhere.  Posted is a check box field in the datagridview.

I also have a submit button.  I would like to be able to check the posted field in the datagridview and when I click on the submit button copy the rows where posted = true to another table.  How can I accomplish this?

I have the datagridview all created with the posted field but that is as far as i got.

Should I create a datatable with matching schema of the datagridview and then somehow populate that? or should I bind the datagridview to my invoices table?  if i bind my datagridview to my invoices table then how do i detect the posted field?
2 Solutions
Hi kpkirishy,
This microsoft link of 101 samples has a good dataview sample that shows you how to add the first column that is not with your database data; that is loading into the datagridview,

Bob LearnedCommented:
Here is an example of creating a DataGridView in unbound mode:

How to: Create an Unbound Windows Forms DataGridView Control


Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now